AliOS Things API HAL OTA Guide - Shaofa/AliOS-Things-Certification-Manual GitHub Wiki
- 1 hal_ota_register_module
- 2 hal_ota_init
- 3 hal_ota_write
- 4 hal_ota_read
- 5 hal_ota_set_boot
- 6 hal_ota_get_default_module
void hal_ota_register_module(hal_ota_module_t *module)
-
Description
Arch register a new module before HAL startup
-
Parameters
None.
-
Returns
None.
hal_stat_t hal_ota_init(void *something)
-
Description
init ota partition
-
Parameters
IN/OUT NAME DESC something extra info for ota init -
Returns
0 : On success, 1 : If an error occurred with any step
hal_stat_t hal_ota_write(hal_ota_module_t *m, volatile uint32_t *off_set,
uint8_t *in_buf , uint32_t in_buf_len)
-
Description
Write data to an area on ota partition
-
Parameters
IN/OUT NAME DESC mRefer the ota module which will be used,default module will be used if value is NULL off_set Point to the start address that the data is written to, andpoint to the last unwritten address after this function isreturned, so you can call this function serval times withoutupdate this start address. inbuf point to the data buffer that will be written to flash in_buf_len The length of the buffe -
Returns
0 : On success, 1 : If an error occurred with any step
hal_stat_t hal_ota_read(hal_ota_module_t *m, volatile uint32_t *off_set,
uint8_t *out_buf, uint32_t out_buf_len)
-
Description
Read data from an area on ota Flash to data buffer in RAM
-
Parameters
IN/OUT NAME DESC m Refer the ota module which will be used,default module will be used if value is NULL off_set Point to the start address that the data is read, and point to the last unread address after this function is returned, so you can call this function serval times without update this start address. out_buf Point to the data buffer that stores the data read from flash out_buf_len The length of the buffe -
Returns
0 : On success, 1 : If an error occurred with any step
hal_stat_t hal_ota_set_boot(hal_ota_module_t *m, void *something)
-
Description
Set boot options when ota reboot
-
Parameters
IN/OUT NAME DESC m Refer the ota module which will be used,default module will be used if value is NULL something boot parms -
Returns
kNoErr : On success. kGeneralErr : If an error occurred with any step
hal_ota_module_t *hal_ota_get_default_module(void)
-
Description
Get the default ota module
-
Parameters
None.
-
Returns
the first registered ota module ,which is the head of module list