Microchip® Advanced Software Framework

provision_ap_example/main21.c File Reference

WINC1500 AP provision example.

Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.

#include "asf.h"
#include "main.h"
#include "common/include/nm_common.h"
#include "driver/include/m2m_wifi.h"
#include "socket/include/socket.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 socket_cb (SOCKET sock, uint8_t u8Msg, void *pvMsg)
 Callback function of TCP client socket. 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...
 
static uint8_t gau8SocketTestBuffer [MAIN_WIFI_M2M_BUFFER_SIZE]
 Receive buffer definition. More...
 
uint32_t gu32HostIp = 0
 IP address of host. More...
 
static SOCKET tcp_client_socket = -1
 
static SOCKET tcp_server_socket = -1
 Socket for TCP communication. More...
 

#define STRING_EOL   "\r\n"
#define STRING_HEADER
Value:
"-- WINC1500 AP provision example --"STRING_EOL \
"-- "BOARD_NAME " --"STRING_EOL \
"-- Compiled: "__DATE__ " "__TIME__ " --"STRING_EOL
#define BOARD_NAME
Definition: app_init.h:140
#define STRING_EOL
Definition: provision_ap_example/main21.c:88

Referenced by main().

static void socket_cb ( SOCKET  sock,
uint8_t  u8Msg,
void *  pvMsg 
)
static
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.
[in]pvMsgA pointer to a buffer containing the notification parameters
Returns
None.

References M2M_WIFI_CONNECTED, M2M_WIFI_DISCONNECTED, M2M_WIFI_REQ_DHCP_CONF, m2m_wifi_request_dhcp_client(), M2M_WIFI_RESP_CON_STATE_CHANGED, and tstrM2mWifiStateChanged::u8CurrState.

Referenced by main().

struct usart_module cdc_uart_module
static

UART module for debug.

uint8_t gau8SocketTestBuffer[MAIN_WIFI_M2M_BUFFER_SIZE]
static

Receive buffer definition.

Referenced by socket_cb().

uint32_t gu32HostIp = 0

IP address of host.

SOCKET tcp_client_socket = -1
static

Referenced by socket_cb().

SOCKET tcp_server_socket = -1
static

Socket for TCP communication.

Referenced by main(), and socket_cb().