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 |
Internal OTA call back function.
[in] | u8OpCode | HIF Opcode type. |
[in] | u16DataSize | HIF data length. |
[in] | u32Addr | HIF address. |
References gpfHFDEraseCb, gpfHFDGetCb, gpfHFDReadCb, gpfOtaNotifCb, gpfOtaUpdateCb, gu8CurrFileHandlerID, hif_receive(), M2M_ERR, M2M_INFO, m2m_memset(), M2M_OTA_RESP_HOST_FILE_DOWNLOAD, M2M_OTA_RESP_HOST_FILE_ERASE, M2M_OTA_RESP_HOST_FILE_READ, M2M_OTA_RESP_HOST_FILE_STATUS, M2M_OTA_RESP_NOTIF_UPDATE_INFO, M2M_OTA_RESP_UPDATE_STATUS, M2M_SUCCESS, NULL, OTA_STATUS_SUCCESS, tstrOtaHostFileReadStatusResp::pFileBuf, tstrOtaHostFileReadStatusResp::u16FileBlockSz, tstrOtaHostFileGetStatusResp::u32OtaFileSize, tstrOtaHostFileGetStatusResp::u8CFHandler, tstrOtaHostFileEraseStatusResp::u8OtaFileEraseStatus, tstrOtaHostFileGetStatusResp::u8OtaFileGetStatus, tstrOtaHostFileReadStatusResp::u8OtaFileReadStatus, tstrOtaUpdateStatusResp::u8OtaUpdateStatus, and tstrOtaUpdateStatusResp::u8OtaUpdateStatusType.
Referenced by m2m_ota_init().
|
static |
|
static |
Referenced by m2m_ota_cb(), and m2m_ota_host_file_erase().
|
static |
Referenced by m2m_ota_cb(), and m2m_ota_host_file_get().
|
static |
Referenced by m2m_ota_cb(), m2m_ota_host_file_erase(), and m2m_ota_host_file_read_hif().
|
static |
Referenced by m2m_ota_cb(), and m2m_ota_init().
|
static |
Referenced by m2m_ota_cb(), and m2m_ota_init().
|
static |
Referenced by m2m_ota_cb(), m2m_ota_host_file_erase(), m2m_ota_host_file_get(), and m2m_ota_host_file_read_hif().