#include "asf.h"
#include "FreeRTOS.h"
#include "osprintf.h"
#include "lwip/ip.h"
#include "lwip/api.h"
#include "lwip/tcpip.h"
#include "lwip/dns.h"
#include "os/include/net_init.h"
#include "os/include/m2m_wifi_ex.h"
#include "driver/include/m2m_wifi.h"
#include "tinyservices.h"
#include <string.h>
#include <stdio.h>
#include <iperf.h>
#include <wchar.h>
#include "utf8/utf8.h"
Data Structures | |
struct | iperf_state |
Macros | |
#define | BUFSIZE IPERF_WIFI_TCP_BUFFER_SIZE |
#define | IPERF_PORT 5001 |
Enumerations | |
enum | iperf_status { E_WAITING = 0, E_CONNECTED, E_CLOSED, E_WAITING = 0, E_CONNECTED, E_CLOSED } |
Functions | |
static sint32 | check_digit (char c) |
void | iperf_tcp_client_task (void *v) |
static void | iperf_tcp_recv (struct netconn *conn) |
static void | iperf_tcp_send (ip_addr_t *local_ip, ip_addr_t *remote_ip, u16_t port) |
void | iperf_tcp_task (void *v) |
TCP task function. More... | |
static void | iperf_udp_recv (struct netconn *conn) |
static void | iperf_udp_send (struct netconn *conn) |
void | iperf_udp_task (void *v) |
UDP task function. More... | |
void | SetServerIpAddr (char *addr, uint32 *u32RemoteIPAddress) |
static void | wifi_cb (uint8 msg_type, void *msg) |
Callback to get the Wi-Fi status update. More... | |
Variables | |
uint8_t | buffer [BUFSIZE] |
static xSemaphoreHandle | firmware_start_sem = NULL |
Firmware start event. More... | |
static volatile bool | gbConnectedWifi = false |
Wi-Fi status variable. More... | |
tstrM2mWifiWepParams | gstrSTAWepParam = WEP_CONN_PARAM |
struct iperf_state | iperf |
uint32_t | sta_connected = 0 |
Number of STA connected. More... | |
struct iperf_stats | stats |
static uint32_t | test_time |
static uint32_t | test_tx |
static ip_addr_t | udp_client_ip |
static uint32_t | udp_client_port |
unsigned int * | utf8_STA_mode_PSK = NULL |
unsigned int * | utf8_STA_mode_SSID = NULL |
#define BUFSIZE IPERF_WIFI_TCP_BUFFER_SIZE |
Referenced by iperf_tcp_client_task(), iperf_tcp_send(), and iperf_tcp_task().
#define IPERF_PORT 5001 |
Referenced by iperf_tcp_client_task(), iperf_tcp_send(), iperf_tcp_task(), iperf_udp_send(), and iperf_udp_task().
enum iperf_status |
|
static |
Referenced by SetServerIpAddr().
void iperf_tcp_client_task | ( | void * | v | ) |
References buffer, client_hdr::bufferlen, BUFSIZE, iperf_state::chdr, E_CLOSED, ERR_OK, client_hdr::flags, HEADER_VERSION1, htonl, ioport_get_pin_level(), ipaddr_ntoa(), iperf, IPERF_CLIENT_PORT, IPERF_PORT, local_ip, M2M_WIFI_CH_ALL, m2m_wifi_connect(), MAIN_WLAN_AUTH, MAIN_WLAN_PSK, MAIN_WLAN_SSID, client_hdr::mAmount, client_hdr::mPort, client_hdr::mWinBand, net_init(), NUM_THREADS, client_hdr::numThreads, os_m2m_wifi_init(), osprintf(), param, tstrWifiInitParam::pfAppWifiCb, SERVER_IP_ADDRESS, SetServerIpAddr(), iperf_state::status, TCP_SND_BUF, TCP_WND, TEST_TIME, wifi_cb(), and xTaskGetTickCount().
|
static |
References client_hdr::bufferlen, iperf_state::chdr, E_CLOSED, E_CONNECTED, E_WAITING, ERR_OK, iperf_state::flags, client_hdr::flags, iperf, client_hdr::mAmount, client_hdr::mPort, client_hdr::mWinBand, netbuf_data(), netbuf_delete(), ntohl, client_hdr::numThreads, osprintf(), netbuf::p, RUN_NOW, iperf_state::status, and pbuf::tot_len.
Referenced by iperf_tcp_task().
References buffer, BUFSIZE, iperf_state::chdr, E_CLOSED, ERR_OK, ipaddr_ntoa(), iperf, IPERF_PORT, client_hdr::mAmount, osprintf(), iperf_state::status, TCP_SND_BUF, and xTaskGetTickCount().
Referenced by iperf_tcp_task().
void iperf_tcp_task | ( | void * | v | ) |
TCP task function.
References BUFF_SIZE, buffer, BUFSIZE, delay_ms, E_WAITING, ERR_OK, iperf_state::flags, HEADER_VERSION1, ipaddr_ntoa(), iperf, IPERF_PORT, iperf_tcp_recv(), iperf_tcp_send(), local_ip, M2M_SUCCESS, M2M_WIFI_CH_ALL, m2m_wifi_connect(), m2m_wifi_send_ethernet_pkt(), MAIN_WLAN_AUTH, MAIN_WLAN_PSK, MAIN_WLAN_SSID, net_init(), NULL, os_m2m_wifi_init(), osprintf(), param, tstrWifiInitParam::pfAppWifiCb, STATION_INTERFACE, iperf_state::status, TCP_WND, vSemaphoreDelete, vTaskDelay(), wifi_cb(), xSemaphoreCreateCounting, xSemaphoreTake, and xTaskGetTickCount().
Referenced by main().
|
static |
References netbuf::addr, server_hdr::datagrams, ERR_OK, server_hdr::error_cnt, server_hdr::flags, HEADER_VERSION1, htonl, UDP_datagram::id, server_hdr::jitter1, server_hdr::jitter2, netbuf_alloc(), netbuf_data(), netbuf_delete(), netbuf_fromaddr, netbuf_fromport, netbuf_new(), ntohl, osprintf(), server_hdr::outorder_cnt, stats, server_hdr::stop_sec, server_hdr::stop_usec, test_time, test_tx, server_hdr::total_len1, server_hdr::total_len2, UDP_datagram::tv_sec, UDP_datagram::tv_usec, udp_client_ip, udp_client_port, iperf_stats::udp_rx_end_sec, iperf_stats::udp_rx_end_usec, iperf_stats::udp_rx_lost, iperf_stats::udp_rx_outorder, iperf_stats::udp_rx_seq, iperf_stats::udp_rx_start_sec, iperf_stats::udp_rx_start_usec, iperf_stats::udp_rx_total_pkt, iperf_stats::udp_rx_total_size, and vTaskDelay().
Referenced by iperf_udp_task().
|
static |
References BUFF_SIZE, buffer, server_hdr::flags, HEADER_VERSION1, htonl, UDP_datagram::id, IPERF_PORT, IPERF_WIFI_UDP_BUFFER_SIZE, M2M_SUCCESS, m2m_wifi_send_ethernet_pkt(), netbuf_alloc(), netbuf_delete(), netbuf_new(), ntohl, osprintf(), STATION_INTERFACE, test_time, test_tx, server_hdr::total_len1, server_hdr::total_len2, udp_client_ip, and xTaskGetTickCount().
Referenced by iperf_udp_task().
void iperf_udp_task | ( | void * | v | ) |
UDP task function.
References ERR_OK, IPERF_PORT, iperf_udp_recv(), iperf_udp_send(), NULL, osprintf(), stats, and vTaskDelay().
Referenced by main().
void SetServerIpAddr | ( | char * | addr, |
uint32 * | u32RemoteIPAddress | ||
) |
References check_digit(), M2M_PRINT, and NULL.
Referenced by iperf_tcp_client_task().
|
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 AP_INTERFACE, htons, M2M_ERR_AP_NOT_FOUND, M2M_ERR_AP_OVERLOAD, M2M_ERR_ASSOC_FAIL, M2M_ERR_AUTH_FAIL, M2M_ERR_LINK_LOSS, M2M_ERR_NONE, M2M_ERR_SEC_CNTRMSR, M2M_ERR_STATION_IS_LEAVING, M2M_WIFI_CH_ALL, m2m_wifi_connect(), M2M_WIFI_CONNECTED, M2M_WIFI_DISCONNECTED, m2m_wifi_request_dhcp_client_ex(), M2M_WIFI_RESP_CON_STATE_CHANGED, M2M_WIFI_RESP_FIRMWARE_STRTED, MAIN_WLAN_AUTH, MAIN_WLAN_PSK, MAIN_WLAN_SSID, msg, NET_IF_REQ_DHCP_CONF, NET_IF_STA, net_interface_down(), net_interface_up(), NULL, osprintf(), P2P_INTERFACE, STATION_INTERFACE, tstrM2mWifiStateChanged::u8CurrState, tstrM2mWifiStateChanged::u8ErrCode, tstrM2mWifiStateChanged::u8IfcId, tstrM2mWifiStateChanged::u8MAcAddr, tstrM2MIPConfig2::u8StaticIP, tstrM2MIPConfig2::u8StaticIPv6, and xSemaphoreGive.
Referenced by iperf_tcp_client_task(), and iperf_tcp_task().
uint8_t buffer[BUFSIZE] |
|
static |
Firmware start event.
tstrM2mWifiWepParams gstrSTAWepParam = WEP_CONN_PARAM |
struct iperf_state iperf |
uint32_t sta_connected = 0 |
Number of STA connected.
Referenced by wifi_cb().
struct iperf_stats stats |
|
static |
Referenced by iperf_udp_recv(), and iperf_udp_send().
|
static |
Referenced by iperf_udp_recv(), and iperf_udp_send().
|
static |
Referenced by iperf_udp_recv(), and iperf_udp_send().
|
static |
Referenced by iperf_udp_recv().
unsigned int * utf8_STA_mode_PSK = NULL |
unsigned int* utf8_STA_mode_SSID = NULL |