Mistake on this page? Email us
fota_app_ifs.h
1 // ----------------------------------------------------------------------------
2 // Copyright 2018-2020 ARM 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 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 
35 // TODO: remove this enum definition
36 typedef enum {
37  FOTA_APP_AUTHORIZATION_TYPE_DOWNLOAD,
38  FOTA_APP_AUTHORIZATION_TYPE_INSTALL,
39 } fota_app_request_type_e;
40 
59 int fota_app_on_download_authorization(
60  uint32_t token,
61  const manifest_firmware_info_t *candidate_info,
62  fota_component_version_t curr_fw_version
63 );
64 
65 
82 int fota_app_on_install_authorization(uint32_t token);
83 
93 int fota_app_on_complete(int32_t status);
94 
100 void fota_app_resume(void);
101 
112 void fota_app_authorize(uint32_t token) fota_deprecated;
113 
126 void fota_app_reject(uint32_t token, int32_t reason) fota_deprecated;
127 
140 void fota_app_defer(uint32_t token) fota_deprecated;
141 
142 
151 void fota_app_authorize_update(void);
152 
160 void fota_app_reject_update(int32_t reason);
161 
169 void fota_app_defer_update(void);
170 
171 
182 void fota_app_on_download_progress(size_t downloaded_size, size_t current_chunk_size, size_t total_size);
183 
184 
185 #if defined(TARGET_LIKE_LINUX)
186 
198 int fota_app_on_install_candidate(const char *candidate_fs_name, const manifest_firmware_info_t *firmware_info);
199 
200 #endif // defined(TARGET_LIKE_LINUX)
201 
202 #ifdef __cplusplus
203 }
204 #endif
205 
206 #endif // MBED_CLOUD_CLIENT_FOTA_ENABLE
207 
208 #endif // __FOTA_APP_IFS_H_