Microchip® Advanced Software Framework

winc3400/ota_firmware_upgrade_example/main21.c File Reference

WINC3400 OTA firmware upgrade example.

Copyright (c) 2017-2019 Microchip Technology Inc. and its subsidiaries.

#include "asf.h"
#include "main.h"
#include "driver/include/m2m_ota.h"
#include "driver/include/m2m_wifi.h"
#include "driver/source/nmasic.h"

Macros

#define STRING_EOL   "\r\n"
 
#define STRING_HEADER
 

Functions

static void configure_console (void)
 Configure UART console. More...
 
int main (void)
 Main application function. More...
 
static void OtaNotifCb (tstrOtaUpdateInfo *pv)
 OTA notify callback. More...
 
static void OtaUpdateCb (uint8 u8OtaUpdateStatusType, uint8 u8OtaUpdateStatus)
 Callback to get the OTA update event. More...
 
static void wifi_cb (uint8_t u8MsgType, void *pvMsg)
 Callback to get the Wi-Fi status update. More...
 

Variables

static struct usart_module cdc_uart_module
 UART module for debug. More...
 

#define STRING_EOL   "\r\n"
#define STRING_HEADER
Value:
"-- WINC3400 OTA firmware upgrade example --"STRING_EOL \
"-- "BOARD_NAME " --"STRING_EOL \
"-- Compiled: "__DATE__ " "__TIME__ " --"STRING_EOL
#define BOARD_NAME
Definition: app_init.h:140
#define STRING_EOL
Definition: winc3400/ota_firmware_upgrade_example/main21.c:105

Referenced by main().

static void OtaNotifCb ( tstrOtaUpdateInfo pv)
static

OTA notify callback.

OTA notify callback typedef.

References printf.

Referenced by main().

static void OtaUpdateCb ( uint8  u8OtaUpdateStatusType,
uint8  u8OtaUpdateStatus 
)
static

Callback to get the OTA update event.

Parameters
[in]u8OtaUpdateStatusTypetype of OTA update status notification. Possible types are:
[in]u8OtaUpdateStatustype of OTA update status detail. Possible types are:

References DL_STATUS, M2M_ERR_FW_VER_MISMATCH, M2M_INFO, m2m_ota_switch_firmware(), M2M_SUCCESS, m2m_wifi_check_ota_rb(), OTA_STATUS_SUCCESS, printf, RB_STATUS, and SW_STATUS.

Referenced by main().

static void wifi_cb ( uint8_t  u8MsgType,
void *  pvMsg 
)
static

Callback to get the Wi-Fi status update.

Parameters
[in]u8MsgTypetype of Wi-Fi notification. Possible types are:
[in]pvMsgA pointer to a buffer containing the notification parameters (if any). It should be casted to the correct data type corresponding to the notification type.

References m2m_ota_start_update(), M2M_WIFI_CH_ALL, m2m_wifi_connect(), M2M_WIFI_CONNECTED, M2M_WIFI_DISCONNECTED, M2M_WIFI_REQ_DHCP_CONF, M2M_WIFI_RESP_CON_STATE_CHANGED, MAIN_OTA_URL, MAIN_WLAN_AUTH, MAIN_WLAN_PSK, MAIN_WLAN_SSID, printf, and tstrM2mWifiStateChanged::u8CurrState.

Referenced by main().

struct usart_module cdc_uart_module
static

UART module for debug.