Lists the full set of available APIs to manage OTA updates and Host File Downloads.
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 in progress.
If no download is in progress, the API will respond with failure.
References hif_send(), M2M_OTA_REQ_ABORT, M2M_REQ_GROUP_OTA, M2M_SUCCESS, and NULL.
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. |
References gpfOtaNotifCb, gpfOtaUpdateCb, hif_register_cb(), M2M_ERR, m2m_ota_cb(), M2M_REQ_GROUP_OTA, and M2M_SUCCESS.
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_ERR_FAIL, M2M_GET_HIF_BLOCK, M2M_HIF_BLOCK_VALUE, m2m_ota_get_firmware_version(), M2M_OTA_REQ_ROLLBACK, M2M_REQ_GROUP_OTA, M2M_SUCCESS, NULL, and tstrM2mRev::u16FirmwareHifInfo.
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, 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.
References hif_send(), M2M_OTA_REQ_START_UPDATE, M2M_REQ_GROUP_OTA, m2m_strlen(), M2M_SUCCESS, and NULL.
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_ERR_FAIL, M2M_GET_HIF_BLOCK, M2M_HIF_BLOCK_VALUE, m2m_ota_get_firmware_version(), M2M_OTA_REQ_SWITCH_FIRMWARE, M2M_REQ_GROUP_OTA, M2M_SUCCESS, NULL, and tstrM2mRev::u16FirmwareHifInfo.
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(), and NULL.