WINC1500 OTA firmware upgrade example.
Copyright (c) 2016-2018 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_t u8OtaUpdateStatusType, uint8_t 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 |
Referenced by main().
|
static |
Configure UART console.
References usart_config::baudrate, cdc_uart_module, usart_config::mux_setting, usart_config::pinmux_pad0, usart_config::pinmux_pad1, usart_config::pinmux_pad2, usart_config::pinmux_pad3, usart_enable(), and usart_get_config_defaults().
Referenced by main().
int main | ( | void | ) |
Main application function.
Application entry point.
References configure_console(), m2m_ota_init(), M2M_SUCCESS, M2M_WIFI_CH_ALL, m2m_wifi_connect(), m2m_wifi_handle_events(), m2m_wifi_init(), MAIN_WLAN_AUTH, MAIN_WLAN_PSK, MAIN_WLAN_SSID, nm_bsp_init(), NULL, OtaNotifCb(), OtaUpdateCb(), tstrWifiInitParam::pfAppWifiCb, STRING_HEADER, system_init(), and wifi_cb().
|
static |
|
static |
Callback to get the OTA update event.
[in] | u8OtaUpdateStatusType | type of OTA update status notification. Possible types are: |
[in] | u8OtaUpdateStatus | type of OTA update status detail. Possible types are:
|
References DL_STATUS, m2m_ota_switch_firmware(), OTA_STATUS_SUCCESS, and SW_STATUS.
Referenced by main().
|
static |
Callback to get the Wi-Fi status update.
[in] | u8MsgType | type of Wi-Fi notification. Possible types are: |
[in] | pvMsg | A 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_request_dhcp_client(), M2M_WIFI_RESP_CON_STATE_CHANGED, MAIN_OTA_URL, MAIN_WLAN_AUTH, MAIN_WLAN_PSK, MAIN_WLAN_SSID, and tstrM2mWifiStateChanged::u8CurrState.
Referenced by main().
|
static |
UART module for debug.
Referenced by cdc_uart_init(), configure_console(), enter_wifi_firmware_download(), getchar_timeout(), main(), mqtt_callback(), and serial_console_init().