Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Callbacks

     Lists the different callbacks that can be used during OTA updates.


Callbacks of type tpfOtaNotifCb and tpfOtaUpdateCb should be passed onto m2m_ota_init at system initialization. Other callbacks are provided to handle the various steps of Host File Download.

Typedefs

typedef void(* tpfFileEraseCb )(uint8 u8Status)
 A callback executed when the file erase has been completed. More...
 
typedef void(* tpfFileGetCb )(uint8 u8Status, uint8 u8Handler, uint32 u32Size)
 A callback to notify the application of the result of the download (success/fail), the generated handler ID and the size of the file which has just finished downloading (size expressed in bytes). More...
 
typedef void(* tpfFileReadCb )(uint8 u8Status, void *pBuff, uint32 u32Size)
 A callback to handle a buffer of data after requesting a Host File read. The callback will provide the status of the read operation and if successful, a pointer to a valid placeholder containing the data read and the amount of data available. Such callback is required when using Host File read via the HIF. More...
 
typedef void(* tpfOtaNotifCb )(tstrOtaUpdateInfo *pstrOtaUpdateInfo)
 
typedef void(* tpfOtaNotifCb )(tstrOtaUpdateInfo *pstrOtaUpdateInfo)
 A callback to get notification about a potential OTA update. More...
 
typedef void(* tpfOtaUpdateCb )(uint8 u8OtaUpdateStatusType, uint8 u8OtaUpdateStatus)
 
typedef void(* tpfOtaUpdateCb )(uint8 u8OtaUpdateStatusType, uint8 u8OtaUpdateStatus)
 A callback to get OTA status update, the callback provides the status type and its status.
The OTA callback provides the download status, the switch to the downloaded firmware status, roll-back status and Host File Download status. More...
 

void(* tpfFileEraseCb)(uint8 u8Status)

A callback executed when the file erase has been completed.

Parameters
[in]u8StatusStatus of the operation (see tenuOtaUpdateStatus).
void(* tpfFileGetCb)(uint8 u8Status, uint8 u8Handler, uint32 u32Size)

A callback to notify the application of the result of the download (success/fail), the generated handler ID and the size of the file which has just finished downloading (size expressed in bytes).

Parameters
[in]u8StatusStatus of the operation (see tenuOtaUpdateStatus).
[in]u8HandlerGenerated handler ID for the new file.
[in]u32SizeTotal size of the downloaded file (in bytes).
Warning
The file handler passed onto this callback will be the valid file handler generated by the WINC when the download finished successfully. This handler will be required for all operations on the file like read and erase.
void(* tpfFileReadCb)(uint8 u8Status, void *pBuff, uint32 u32Size)

A callback to handle a buffer of data after requesting a Host File read. The callback will provide the status of the read operation and if successful, a pointer to a valid placeholder containing the data read and the amount of data available. Such callback is required when using Host File read via the HIF.

Parameters
[in]u8StatusStatus of the operation (see tenuOtaUpdateStatus).
[in]pBuffPointer to a placeholder where the data can be retrieved from.
[in]u32SizeAmount of data available after reading (in bytes).
Warning
After the callback is executed, pBuff will be freed.
typedef void(* tpfOtaNotifCb)(tstrOtaUpdateInfo *pstrOtaUpdateInfo)
void(* tpfOtaNotifCb)(tstrOtaUpdateInfo *pstrOtaUpdateInfo)

A callback to get notification about a potential OTA update.

Parameters
[in]pstrOtaUpdateInfoA structure to provide notification payload.
See Also
tstrOtaUpdateInfo
Warning
The notification is not supported (Not implemented yet)
typedef void(* tpfOtaUpdateCb)(uint8 u8OtaUpdateStatusType, uint8 u8OtaUpdateStatus)
void(* tpfOtaUpdateCb)(uint8 u8OtaUpdateStatusType, uint8 u8OtaUpdateStatus)

A callback to get OTA status update, the callback provides the status type and its status.
The OTA callback provides the download status, the switch to the downloaded firmware status, roll-back status and Host File Download status.

A callback to get OTA status update, the callback provides the status type and its status.
The OTA callback provides the download status, the switch to the downloaded firmware status and roll-back status.

Parameters
[in]u8OtaUpdateStatusTypePossible values are listed in tenuOtaUpdateStatusType.
[in]u8OtaUpdateStatusPossible values are listed as enumerated by tenuOtaUpdateStatus.
Note
Executes other callbacks passed to the OTA module.
See Also
tenuOtaUpdateStatusType tenuOtaUpdateStatus