Microchip® Advanced Software Framework

main21.c File Reference

WINC1500 UDP Client 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"

Data Structures

struct  s_msg_wifi_product
 Message format definitions. More...
 
struct  s_msg_wifi_product_main
 

Macros

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

Typedefs

typedef struct s_msg_wifi_product t_msg_wifi_product
 Message format definitions. More...
 
typedef struct
s_msg_wifi_product_main 
t_msg_wifi_product_main
 

Functions

static void configure_console (void)
 Configure UART console. More...
 
int main (void)
 Main application function. 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 t_msg_wifi_product msg_wifi_product
 Message format declarations. More...
 
static t_msg_wifi_product_main msg_wifi_product_main
 
static uint8_t packetCnt = 0
 UDP packet count. More...
 
static SOCKET tx_socket = -1
 Socket for Tx. More...
 
static uint8_t wifi_connected
 Wi-Fi connection state. More...
 

#define STRING_EOL   "\r\n"
#define STRING_HEADER
Value:
"-- WINC1500 UDP client example --"STRING_EOL \
"-- "BOARD_NAME " --"STRING_EOL \
"-- Compiled: "__DATE__ " "__TIME__ " --"STRING_EOL
#define STRING_EOL
Definition: main21.c:95
#define BOARD_NAME
Name string macro.
Definition: saml21_xplained_pro.h:65

Referenced by main().

Message format definitions.

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. Existing types are:

References 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_WLAN_AUTH, MAIN_WLAN_PSK, MAIN_WLAN_SSID, tstrM2mWifiStateChanged::u8CurrState, and wifi_connected.

Referenced by main().

struct usart_module cdc_uart_module
static

UART module for debug.

Referenced by configure_console().

t_msg_wifi_product msg_wifi_product
static
Initial value:
= {
}
#define MAIN_WIFI_M2M_PRODUCT_NAME
Definition: main.h:45

Message format declarations.

t_msg_wifi_product_main msg_wifi_product_main
static
Initial value:
= {
}
#define MAIN_WIFI_M2M_PRODUCT_NAME
Definition: main.h:45
uint8_t packetCnt = 0
static

UDP packet count.

Referenced by main().

SOCKET tx_socket = -1
static

Socket for Tx.

Referenced by main().

uint8_t wifi_connected
static

Wi-Fi connection state.

Referenced by main(), and wifi_cb().