Mistake on this page? Email us
fota_app_ifs.h
1 // ----------------------------------------------------------------------------
2 // Copyright 2019-2021 Pelion Ltd.
3 //
4 // SPDX-License-Identifier: Apache-2.0
5 //
6 // Licensed under the Apache License, Version 2.0 (the "License");
7 // you may not use this file except in compliance with the License.
8 // You may obtain a copy of the License at
9 //
10 // http://www.apache.org/licenses/LICENSE-2.0
11 //
12 // Unless required by applicable law or agreed to in writing, software
13 // distributed under the License is distributed on an "AS IS" BASIS,
14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 // See the License for the specific language governing permissions and
16 // limitations under the License.
17 // ----------------------------------------------------------------------------
18 
19 #ifndef __FOTA_APP_IFS_H_
20 #define __FOTA_APP_IFS_H_
21 
22 #include "fota/fota_config.h"
23 
24 #if defined(MBED_CLOUD_CLIENT_FOTA_ENABLE)
25 
26 #include "fota/fota_status.h"
27 #include "fota/fota_header_info.h"
28 #include "fota/fota_manifest.h"
29 #include "fota/fota_component.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
65 int fota_app_on_download_authorization(
66  const manifest_firmware_info_t *candidate_info,
67  fota_component_version_t curr_fw_version
68 );
69 
70 
92 int fota_app_on_install_authorization(void);
93 
108 int fota_app_on_complete(int32_t status);
109 
122 void fota_app_resume(void);
123 
130 void fota_app_authorize(void);
131 
139 void fota_app_reject(int32_t reason);
140 
155 void fota_app_defer(void);
156 
168 void fota_app_postpone_reboot(void);
169 
170 
181 void fota_app_on_download_progress(size_t downloaded_size, size_t current_chunk_size, size_t total_size);
182 
199 int fota_app_on_main_app_verify_install(const fota_header_info_t *expected_header_info);
200 
201 #if defined(TARGET_LIKE_LINUX)
202 
216 int fota_app_on_install_candidate(const char *candidate_fs_name, const manifest_firmware_info_t *firmware_info);
217 
218 #if defined(MBED_CLOUD_CLIENT_FOTA_LINUX_SINGLE_MAIN_FILE)
219 
235 int fota_app_install_main_app(const char *candidate_file_name);
236 
237 #endif // defined(MBED_CLOUD_CLIENT_FOTA_LINUX_SINGLE_MAIN_FILE)
238 
239 #endif // defined(TARGET_LIKE_LINUX)
240 
241 #ifdef __cplusplus
242 }
243 #endif
244 
245 #endif // defined(MBED_CLOUD_CLIENT_FOTA_ENABLE)
246 
247 #endif // __FOTA_APP_IFS_H_