Microchip® Advanced Software Framework

winc1500/host_drv/driver/include/m2m_ota.h File Reference

WINC OTA Upgrade API Interface.

Copyright (c) 2016-2021 Microchip Technology Inc. and its subsidiaries.

#include "common/include/nm_common.h"
#include "driver/include/m2m_types.h"
#include "driver/source/nmdrv.h"

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)
 A callback to get notification about a potential OTA update. More...
 
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...
 

Functions

NMI_API sint8 m2m_ota_abort (void)
 Request OTA Abort. More...
 
NMI_API sint8 m2m_ota_get_firmware_version (tstrM2mRev *pstrRev)
 Get the OTA Firmware version. More...
 
NMI_API sint8 m2m_ota_host_file_erase (uint8 u8Handler, tpfFileEraseCb pfHFDEraseCb)
 Erase any traces of an existing file, this means from host driver and WINC firmware. More...
 
NMI_API sint8 m2m_ota_host_file_get (unsigned char *pcDownloadUrl, tpfFileGetCb pfHFDGetCb)
 Download a file from a remote location and store it in the WINC's Flash. More...
 
NMI_API sint8 m2m_ota_host_file_read_hif (uint8 u8Handler, uint32 u32Offset, uint32 u32Size, tpfFileReadCb pfHFDReadCb)
 Read a certain amount of bytes from a file in WINC's Flash using HIF transfer. More...
 
NMI_API sint8 m2m_ota_host_file_read_spi (uint8 u8Handler, uint8 *pu8Buff, uint32 u32Offset, uint32 u32Size)
 Read a certain amount of bytes from a file in WINC's Flash using SPI transfer. 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...