Lists the full set of available APIs to manage OTA updates and Host File Downloads.
Modules | |
Common | |
WINC | |
HFD | |
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 (unsigned char *pcDownloadUrl) |
Request OTA start update using the downloaded URL. More... | |
NMI_API sint8 | m2m_ota_switch_firmware (void) |
Switch to the upgraded Firmware. More... | |
sint8 | m2m_wifi_check_ota_rb (void) |
Synchronous API to check presence and compatibility of the WINC image that is stored in the inactive flash partition. This is the image that would run on the WINC IC if m2m_ota_switch_firmware or m2m_ota_rollback were called, followed by a reset of the WINC IC. More... | |
sint8 m2m_ota_abort | ( | void | ) |
Request OTA Abort.
Request the WINC to abort an OTA or Host File download in progress.
If no download is in progress, the API will respond with failure.
Request the WINC to abort an OTA in progress.
If no download is in progress, the API will respond with failure.
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 MUST for all the 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. |
[in] | pfOtaUpdateCb | OTA Update callback function. |
[in] | pfOtaNotifCb | OTA Notify callback function. |
Referenced by main().
sint8 m2m_ota_notif_check_for_update | ( | void | ) |
Check for OTA update.
Synchronous function to check for the OTA update using the Notification Server URL.
Function is not implemented (not supported at the current version).
Schedule OTA update.
Schedule OTA notification Server check for update request after specific number of days.
Function is not implemented (not supported at the current version).
[in] | u32Period | Period in days |
[in] | u32Period | Period in days |
Set the OTA url.
Set the OTA notification server URL, the function needs to be called before any check for update.
This functionality is not supported by WINC firmware.
[in] | u8Url | The url server address. |
[in] | u8Url | Set the OTA notification server URL, the function needs to be called before any check for update. |
sint8 m2m_ota_rollback | ( | void | ) |
Request OTA Rollback image.
Request OTA Roll-back to the old (inactive) WINC image, the WINC firmware will check the validity of the inactive image and activate it if 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.
Referenced by main().
sint8 m2m_ota_start_update | ( | unsigned char * | pcDownloadUrl | ) |
Request OTA start update using the downloaded URL.
Request OTA start update using the download URL. The 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.
Request OTA start update using the download URL. The 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, followed by a WINC reset.
[in] | pcDownloadUrl | The download firmware URL, you get it from device info. |
[in] | pcDownloadUrl | 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:
It also makes use of m2m_wifi_check_ota_rb in order to inform OTA decisions.
[in] | pcDownloadUrl | 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:
Referenced by wifi_cb().
sint8 m2m_ota_switch_firmware | ( | void | ) |
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 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.
Referenced by OtaUpdateCb().
sint8 m2m_wifi_check_ota_rb | ( | void | ) |
Synchronous API to check presence and compatibility of the WINC image that is stored in the inactive flash partition. This is the image that would run on the WINC IC if m2m_ota_switch_firmware or m2m_ota_rollback were called, followed by a reset of the WINC IC.
Synchronous API to check presence and compatibility of the WINC image that is stored in the inactive flash partition. This is the image that would run on the WINC if m2m_ota_switch_firmware or m2m_ota_rollback were called, followed by a reset of the WINC.
References hif_check_compatibility(), M2M_SUCCESS, nm_get_hif_info(), NULL, and ret.
Referenced by main(), and OtaUpdateCb().