#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] |
Convert a 2-byte integer (short) from the host representation to the Network byte order representation.
Referenced by http_client_send_request(), and http_connection().
#define HTTP_REQUEST_PART1 |
Referenced by http_connection().
#define HTTP_REQUEST_PART2 |
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" |
typedef struct s_msg_wifi_product t_msg_wifi_product |
Message format definitions.
void http_connection | ( | char * | host_name, |
uint16 | port | ||
) |
References _htons, buffer, HTTP_REQUEST_PART1, HTTP_REQUEST_PART2, IPV4_BYTE, osprintf(), RECV_BUF_SIZE, and SEND_BUF_SIZE.
Referenced by wilc_task_1().
void tcp_client | ( | void | ) |
References cmd::au8ParamsList, htonl, htons, MAIN_WIFI_M2M_PACKET_COUNT, NULL, osprintf(), temp_cmd_content, and vTaskDelay().
Referenced by wilc_task_1().
void tcp_server | ( | void | ) |
References cmd::au8Cmd, cmd::au8ParamsList, htonl, htons, local_ip, MAIN_WIFI_M2M_BUFFER_SIZE, MAIN_WIFI_M2M_PACKET_COUNT, osprintf(), temp_cmd_content, and cmd::u8NumOfParameters.
Referenced by wilc_task_1().
void udp_client | ( | void | ) |
References cmd::au8ParamsList, htonl, htons, MAIN_WIFI_M2M_PACKET_COUNT, NULL, osprintf(), RECV_BUF_SIZE, temp_cmd_content, and vTaskDelay().
Referenced by wilc_task_1().
void udp_server | ( | void | ) |
References cmd::au8ParamsList, htonl, htons, local_ip, MAIN_WIFI_M2M_BUFFER_SIZE, MAIN_WIFI_M2M_PACKET_COUNT, osprintf(), and temp_cmd_content.
Referenced by wilc_task_1().
|
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 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().
|
static |
References AT_MAX_CONTROL_SUBTYPE, AT_MAX_DATA_SUBTYPE, AT_MAX_MANGEMENT_SUBTYPE, tstrM2MWifiRxPacketInfo::au8DstMacAddress, tstrM2MWifiRxPacketInfo::au8SrcMacAddress, CONTROL, DATA_BASICTYPE, M2M_INFO, MANAGEMENT, MON_MODE_MAX_PKT_COUNT, npkt, NULL, os_m2m_wifi_disable_monitoring_mode(), print_monitoring_result(), tstrMonstats::s32AnyDataFrame, tstrFilterStat::s32NumPkt, tstrMonstats::strFilterSubtype, u8ControlSubtype, u8DataSubType, tstrM2MWifiRxPacketInfo::u8FrameSubtype, tstrM2MWifiRxPacketInfo::u8FrameType, and u8MangmentSubtype.
Referenced by wilc_task_1().
void wilc_task_1 | ( | void * | argument | ) |
AT commands main function.
References ANT_MODE, ANT_SWTCH_GPIO_CTRL_MODE, ANTENNA_GPIO_NUM_1, ANTENNA_GPIO_NUM_2, cmd::au8Cmd, cmd::au8ParamsList, http_connection(), http_downloader(), iperf_tcp_server(), iperf_udp_server(), m2m_wifi_set_antenna_mode(), net_init(), NULL, os_m2m_wifi_init(), param, tstrWifiInitParam::pfAppMonCb, tstrWifiInitParam::pfAppWifiCb, ping_function(), pvPortMalloc(), tcp_client(), tcp_server(), temp_cmd_content, cmd::u8NumOfParameters, udp_client(), udp_server(), vPortFree(), vSemaphoreCreateBinary, vSemaphoreDelete, wifi_cb(), wifi_monitoring_cb(), xSemaphoreCreateCounting, and xSemaphoreTake.
Referenced by main().
xSemaphoreHandle at_cmd_task1_sem |
|
static |
Firmware start event.
tstrMonstats gstrMonitorControlStats |
tstrMonstats gstrMonitorDataStats |
tstrMonstats gstrMonitorMangementStats |
uint32_t local_ip |
Referenced by iperf_tcp_client_task(), iperf_tcp_server(), iperf_tcp_task(), tcp_server(), udp_server(), and wifi_cb().
|
static |
Message format declarations.
|
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().