Functions | |
NMI_API sint8 | m2m_ota_abort (void) |
Request OTA Abort. More... | |
NMI_API sint8 | m2m_ota_init (tpfOtaUpdateCb pfOtaUpdateCb, tpfOtaNotifCb pfOtaNotifCb) |
Initialize the OTA layer. More... | |
NMI_API sint8 | m2m_ota_notif_check_for_update (void) |
check for ota update More... | |
NMI_API sint8 | m2m_ota_notif_sched (uint32 u32Period) |
Schedule OTA update. More... | |
NMI_API sint8 | m2m_ota_notif_set_url (uint8 *u8Url) |
Set the OTA url. More... | |
NMI_API sint8 | m2m_ota_rollback (void) |
Request OTA Rollback image. More... | |
NMI_API sint8 | m2m_ota_start_update (uint8 *u8DownloadUrl) |
Request OTA start update using the downloaded url. More... | |
NMI_API sint8 | m2m_ota_switch_firmware (void) |
Switch to the upgraded Firmware. More... | |
Request OTA Abort.
Abort an ota in progress (eg if server has stalled) and clean up
NMI_API sint8 m2m_ota_init | ( | tpfOtaUpdateCb | pfOtaUpdateCb, |
tpfOtaNotifCb | pfOtaNotifCb | ||
) |
Initialize the OTA layer.
Synchronous initialization function for the OTA layer by registering the update callback. The notification callback is not supported at the current version. Calling this API is a prerequisite for all other OTA API's.
[in] | pfOtaUpdateCb | OTA Update callback function |
[in] | pfOtaNotifCb | OTA notify callback function |
[in] | pfOtaUpdateCb | OTA Update callback function |
[in] | pfOtaNotifCb | OTA notify callback function |
check for ota update
Synchronous function to check for the OTA update using the Notification Server URL. This functionality is not supported by WINC firmware.
Schedule OTA update.
Schedule OTA notification Server check for update request after specific number of days. This functionality is not supported by WINC firmware.
[in] | u32Period | Period in days |
[in] | u32Period | Period in days |
Set the OTA url.
Set the OTA notification server URL, the functions need to be called before any check for update. This functionality is not supported by WINC firmware.
[in] | u8Url | Set the OTA notification server URL, the functions need to be called before any check for update. |
[in] | u8Url | The url server address |
Request OTA Rollback image.
Request rollback to the old (inactive) WINC image. The WINC firmware will check the validity of the inactive image and activate it if it is valid. On completion, a callback of type tpfOtaUpdateCb is called (application must previously have provided the callback via m2m_ota_init()). If the callback indicates successful activation, the newly-activated image will start running after next system reset.
Request OTA start update using the downloaded url.
Request OTA start update using the downloaded URL. The firmware OTA module will download the OTA image, ensure integrity of the image, and update the validity of the image in the control structure. On completion, a callback of type tpfOtaUpdateCb is called (callback previously provided via m2m_ota_init()). Switching to the updated image additionally requires completion of m2m_ota_switch_firmware(), and system_reset().
[in] | u8DownloadUrl | The download firmware URL, according to the application server. |
This example shows how an OTA image update and switch is carried out. It demonstrates use of the following OTA APIs: m2m_ota_init() tpfOtaUpdateCb m2m_ota_start_update() m2m_ota_switch_firmware() m2m_ota_rollback() It also makes use of m2m_wifi_check_ota_rb() in order to inform OTA decisions.
[in] | u8DownloadUrl | The download firmware url, you get it from device info |
Switch to the upgraded Firmware.
Request switch to the updated WINC image. The WINC firmware will check the validity of the inactive image and activate it if it is valid. On completion, a callback of type tpfOtaUpdateCb is called (application must previously have provided the callback via m2m_ota_init()). If the callback indicates successful activation, the newly-activated image will start running after next system reset.