Skip to content

Commit 35e35e0

Browse files
committed
fota:add API for low level fota interface
Signed-off-by: Ajay Bhargav <[email protected]>
1 parent 1d2d57e commit 35e35e0

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

include/fota.h

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,45 @@ int fota_set_interval(int hours);
7171
*/
7272
int fota_get_interval(void);
7373

74+
/**
75+
* @defgroup APPFOTA
76+
* @brief These functions are used to update application firmware
77+
* from external source. User can write their own update interface
78+
* and use these function to interface with low level firmware update.
79+
*
80+
* @{
81+
*/
82+
83+
/**
84+
* @brief Initialize application firmware update
85+
*
86+
* @param handle [out] handle to use in subsequent calls
87+
* @return return 0 on success, negative value on error
88+
*/
89+
int appfota_init(int *handle);
90+
91+
/**
92+
* @brief Write firmware data to application firmware update
93+
*
94+
* @param handle [in] handle returned by appfota_init()
95+
* @param buff [in] buffer containing firmware data
96+
* @param len [in] length of buffer
97+
* @return return 0 on success, negative value on error
98+
*/
99+
int appfota_write(int handle, const void *buff, size_t len);
100+
101+
/**
102+
* @brief Finish application firmware update, If the firmware binary
103+
* is valid, system will enter bootloader and update firmware. If the
104+
* firmware binary is invalid, an error will be returned.
105+
*
106+
* @param handle [in] handle returned by appfota_init()
107+
* @return return negative value on error
108+
*/
109+
int appfota_finish(int handle);
110+
111+
/** @} */
112+
74113
#ifdef __cplusplus
75114
}
76115
#endif

0 commit comments

Comments
 (0)