WINC1500 HTTP provision example.
Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
#include "asf.h"
#include "common/include/nm_common.h"
#include "driver/include/m2m_wifi.h"
#include "main.h"
Macros | |
#define | HEX2ASCII(x) (((x) >= 10) ? (((x) - 10) + 'A') : ((x) + '0')) |
#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 | set_dev_name_to_mac (uint8 *name, uint8 *mac_addr) |
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 HEX2ASCII | ( | x | ) | (((x) >= 10) ? (((x) - 10) + 'A') : ((x) + '0')) |
Referenced by set_dev_name_to_mac().
#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().
int main | ( | void | ) |
Main application function.
References tstrM2MAPConfig::au8DHCPServerIP, tstrM2MAPConfig::au8SSID, configure_console(), gacDeviceName, gacHttpProvDomainName, gau8MacAddr, gstrM2MAPConfig, m2m_strlen(), M2M_SUCCESS, m2m_wifi_get_mac_address(), m2m_wifi_get_otp_mac_address(), m2m_wifi_handle_events(), m2m_wifi_init(), m2m_wifi_set_device_name(), m2m_wifi_set_mac_address(), m2m_wifi_start_provision_mode(), mac_addr, MAIN_HTTP_PROV_SERVER_DOMAIN_NAME, nm_bsp_init(), NULL, tstrWifiInitParam::pfAppWifiCb, printf, ret, set_dev_name_to_mac(), STRING_HEADER, system_init(), and wifi_cb().
References HEX2ASCII, len, and m2m_strlen().
Referenced by main().
|
static |
Callback to get the Wi-Fi status update.
[in] | u8MsgType | type of Wi-Fi notification. |
[in] | pvMsg | A pointer to a buffer containing the notification parameters |
References tstrM2MProvisionInfo::au8Password, tstrM2MProvisionInfo::au8SSID, M2M_SUCCESS, 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, M2M_WIFI_RESP_PROVISION_INFO, printf, tstrM2mWifiStateChanged::u8CurrState, tstrM2MProvisionInfo::u8SecType, and tstrM2MProvisionInfo::u8Status.
Referenced by main().
|
static |
UART module for debug.