Functions | |
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_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).
References hif_send(), M2M_OTA_REQ_NOTIF_CHECK_FOR_UPDATE, M2M_REQ_GROUP_OTA, M2M_SUCCESS, and NULL.
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 |
References hif_send(), M2M_OTA_REQ_NOTIF_CHECK_FOR_UPDATE, M2M_REQ_GROUP_OTA, M2M_SUCCESS, and NULL.
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. |
References hif_send(), M2M_OTA_REQ_NOTIF_SET_URL, M2M_REQ_GROUP_OTA, m2m_strlen(), M2M_SUCCESS, and NULL.
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.
References hif_send(), M2M_OTA_REQ_ROLLBACK_FW, M2M_REQ_GROUP_OTA, M2M_SUCCESS, and NULL.
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.
[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:
References hif_send(), M2M_OTA_REQ_START_FW_UPDATE, M2M_REQ_GROUP_OTA, m2m_strlen(), M2M_SUCCESS, and NULL.
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.
References hif_send(), M2M_OTA_REQ_SWITCH_FIRMWARE, M2M_REQ_GROUP_OTA, M2M_SUCCESS, and NULL.
Referenced by OtaUpdateCb().