Microchip® Advanced Software Framework

application.c File Reference
#include "application.h"
#include "FreeRTOS.h"
#include "osprintf.h"
#include "os/include/net_init.h"
#include "os/include/m2m_wifi_ex.h"
#include "lwip/def.h"
#include "at_cmd_handler/at_cmd_Handler.h"
#include "iperf/iperf.h"
#include "http_downloader/httpdownloader.h"
#include "ota_fw_update/ota_fw_update.h"
#include "lwip/sockets.h"
#include "lwip/api.h"
#include "lwip/netdb.h"
#include <string.h>
#include <stdio.h>

Data Structures

struct  s_msg_wifi_product
 Message format definitions. More...
 

Macros

#define _htons(A)   (uint16)((((uint16) (A)) << 8) | (((uint16) (A)) >> 8))
 Convert a 2-byte integer (short) from the host representation to the Network byte order representation. More...
 
#define HTTP_REQUEST_PART1
 
#define HTTP_REQUEST_PART2
 
#define IPV4_BYTE(val, index)   ((val >> (index * 8)) & 0xFF)
 IP address parsing. More...
 
#define RECV_BUF_SIZE   256
 
#define SEND_BUF_SIZE   256
 
#define STRING_EOL   "\r\n"
 

Typedefs

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

Functions

void http_connection (char *host_name, uint16 port)
 
void tcp_client ()
 
void tcp_server ()
 
void udp_client ()
 
void udp_server ()
 
static void wifi_cb (uint8_t u8MsgType, void *pvMsg)
 Callback to get the Wi-Fi status update. More...
 
static void wifi_monitoring_cb (tstrM2MWifiRxPacketInfo *pstrWifiRxPacket, uint8 *pu8Payload, uint16 u16PayloadSize)
 
void wilc_task_1 (void *argument)
 AT commands main function. More...
 

Variables

xSemaphoreHandle at_cmd_task1_sem
 
static xSemaphoreHandle firmware_start_sem = NULL
 Firmware start event. More...
 
tstrMonstats gstrMonitorControlStats
 
tstrMonstats gstrMonitorDataStats
 
tstrMonstats gstrMonitorMangementStats
 
uint32_t local_ip
 
static t_msg_wifi_product msg_wifi_product
 Message format declarations. More...
 
static int npkt =0
 
uint8 u8ControlSubtype [AT_MAX_CONTROL_SUBTYPE]
 
uint8 u8DataSubType [AT_MAX_DATA_SUBTYPE]
 
uint8 u8MangmentSubtype [AT_MAX_MANGEMENT_SUBTYPE]
 

#define _htons (   A)    (uint16)((((uint16) (A)) << 8) | (((uint16) (A)) >> 8))
#define HTTP_REQUEST_PART1
Value:
"OPTIONS * HTTP/1.1"STRING_EOL \
"User-Agent: atmel/1.0.2"STRING_EOL \
"Host: "
#define STRING_EOL
Definition: application.c:54

Referenced by http_connection().

#define HTTP_REQUEST_PART2
Value:
STRING_EOL"Connection: Keep-Alive"STRING_EOL \
"Accept-Encoding: "STRING_EOL \
"Accept-Charset: utf-8"STRING_EOL \
#define STRING_EOL
Definition: application.c:54

Referenced by http_connection().

#define IPV4_BYTE (   val,
  index 
)    ((val >> (index * 8)) & 0xFF)

IP address parsing.

Referenced by http_connection().

#define RECV_BUF_SIZE   256

Referenced by http_connection(), and udp_client().

#define SEND_BUF_SIZE   256

Referenced by http_connection().

#define STRING_EOL   "\r\n"

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.

References tstrM2MConnInfo::acSSID, AP_INTERFACE, AT_INDEX_RSSI, AT_MAX_CMD_LENGTH, AT_SEND_OK, tstrM2mWifiscanResult::au8BSSID, tstrM2MWPSInfo::au8PSK, tstrM2MWPSInfo::au8SSID, tstrM2mWifiscanResult::au8SSID, CONF_METHOD_DISPLAY, CONF_METHOD_KEYPAD, get_cmd_txt(), gstrAllStatus, htons, IP4_ADDR, local_ip, M2M_INFO, m2m_strlen(), M2M_SUCCESS, m2m_wifi_allow_p2p_connection(), M2M_WIFI_CONNECTED, M2M_WIFI_DISCONNECTED, m2m_wifi_get_mac_address(), M2M_WIFI_REQ_P2P_AUTH, m2m_wifi_req_scan_result(), m2m_wifi_request_dhcp_client_ex(), m2m_wifi_request_static_client_ex(), M2M_WIFI_RES_WPS, M2M_WIFI_RESP_CON_STATE_CHANGED, M2M_WIFI_RESP_CONN_INFO, M2M_WIFI_RESP_CURRENT_RSSI, M2M_WIFI_RESP_FIRMWARE_STRTED, M2M_WIFI_RESP_SCAN_DONE, M2M_WIFI_RESP_SCAN_RESULT, NET_IF_REQ_DHCP_CONF, NET_IF_STA, net_interface_down(), net_interface_up(), net_set_interface_address(), NULL, os_m2m_wifi_connect(), os_m2m_wifi_get_num_ap_found(), os_m2m_wifi_set_p2p_pin(), osprintf(), P2P_INTERFACE, tstrM2mWifiscanResult::s8rssi, tstrM2MConnInfo::s8RSSI, tstrM2mScanDone::s8ScanState, SERVICE_IS_RUNNING, SERVICE_IS_STOPPED, StaticIPcfg, STATION_INTERFACE, tstrM2MP2pDevInfo::u16CfgMethods, tstrM2MIPConfig::u32Gateway, tstrM2MIPConfig::u32StaticIP, connect_status::u8Ap_status, tstrM2MWPSInfo::u8AuthType, tstrM2mWifiscanResult::u8AuthType, tstrM2MWPSInfo::u8Ch, tstrM2mWifiscanResult::u8ch, tstrM2mWifiStateChanged::u8CurrState, tstrM2mWifiStateChanged::u8IfcId, tstrM2mWifiscanResult::u8index, tstrM2mWifiStateChanged::u8MAcAddr, tstrM2mScanDone::u8NumofCh, tstrM2MConnInfo::u8SecType, connect_status::u8Sta_status, tstrM2MIPConfig2::u8StaticIP, tstrM2MIPConfig2::u8StaticIPv6, use_static_IP, vTaskDelay(), and xSemaphoreGive.

Referenced by wilc_task_1().

xSemaphoreHandle at_cmd_task1_sem
xSemaphoreHandle firmware_start_sem = NULL
static

Firmware start event.

tstrMonstats gstrMonitorControlStats
tstrMonstats gstrMonitorDataStats
tstrMonstats gstrMonitorMangementStats
t_msg_wifi_product msg_wifi_product
static
Initial value:
= {
}
#define MAIN_WIFI_M2M_PRODUCT_NAME
Definition: components/wifi/winc3400/simple_tcp_client_example/main.h:45

Message format declarations.

int npkt =0
static

Referenced by wifi_monitoring_cb().

uint8 u8ControlSubtype[AT_MAX_CONTROL_SUBTYPE]

Referenced by wifi_monitoring_cb().

uint8 u8DataSubType[AT_MAX_DATA_SUBTYPE]

Referenced by wifi_monitoring_cb().

uint8 u8MangmentSubtype[AT_MAX_MANGEMENT_SUBTYPE]

Referenced by wifi_monitoring_cb().