Microchip® Advanced Software Framework

winc1500/host_drv/driver/source/m2m_ota.c File Reference

NMC1500 IoT OTA 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/include/m2m_ota.h"
#include "driver/source/m2m_hif.h"
#include "spi_flash/include/spi_flash.h"
#include "driver/include/m2m_wifi.h"
#include "spi_flash/include/flexible_flash.h"

Data Structures

struct  FileBlockDescriptor
 

Functions

NMI_API sint8 m2m_ota_abort (void)
 Request OTA Abort. More...
 
static void m2m_ota_cb (uint8 u8OpCode, uint16 u16DataSize, uint32 u32Addr)
 Internal OTA call back function. More...
 
NMI_API sint8 m2m_ota_get_firmware_version (tstrM2mRev *pstrRev)
 Synchronous API to obtain the firmware version 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...
 
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...
 

Variables

static FileBlockDescriptor FileBlock
 
static tpfFileEraseCb gpfHFDEraseCb = NULL
 
static tpfFileGetCb gpfHFDGetCb = NULL
 
static tpfFileReadCb gpfHFDReadCb = NULL
 
static tpfOtaNotifCb gpfOtaNotifCb = NULL
 
static tpfOtaUpdateCb gpfOtaUpdateCb = NULL
 
static uint8 gu8CurrFileHandlerID = HFD_INVALID_HANDLER
 

FileBlockDescriptor FileBlock
static
tpfFileEraseCb gpfHFDEraseCb = NULL
static
tpfFileGetCb gpfHFDGetCb = NULL
static
tpfOtaNotifCb gpfOtaNotifCb = NULL
static

Referenced by m2m_ota_cb(), and m2m_ota_init().

tpfOtaUpdateCb gpfOtaUpdateCb = NULL
static

Referenced by m2m_ota_cb(), and m2m_ota_init().