CMSIS-Driver Validation  
Driver Validation
 All Files Functions Variables Macros Groups Pages
DV_WIFI.c File Reference
#include "cmsis_dv.h"
#include "DV_WiFi_Config.h"
#include "DV_Framework.h"
#include "Driver_WiFi.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Macros

#define ECHO_PORT   7
 
#define DISCARD_PORT   9
 
#define CHARGEN_PORT   19
 
#define ASSISTANT_PORT   5000
 
#define TCP_REJECTED_PORT   5001
 
#define TCP_TIMEOUT_PORT   5002
 
#define F_CREATE   0x00000001
 
#define F_CREATE_TCP   F_CREATE
 
#define F_CREATE_UDP   0x00000002
 
#define F_CLOSE   0x00000004
 
#define F_BIND   0x00000008
 
#define F_LISTEN   0x00000010
 
#define F_ACCEPT   0x00000020
 
#define F_CONNECT   0x00000040
 
#define F_RECV   0x00000080
 
#define F_RECVFROM   0x00000100
 
#define F_SEND   0x00000200
 
#define F_SENDTO   0x00000400
 
#define F_GETSOCKNAME   0x00000800
 
#define F_GETPEERNAME   0x00001000
 
#define F_GETOPT   0x00002000
 
#define F_SETOPT   0x00004000
 
#define F_GETHOSTBYNAME   0x00008000
 
#define F_PING   0x00010000
 
#define F_SEND_CTRL   F_PING
 
#define F_XFER_FIXED   0x00020000
 
#define F_XFER_INCR   0x00040000
 
#define F_SEND_FRAG   0x00080000
 
#define F_UPLOAD   F_SEND_FRAG
 
#define F_RECV_FRAG   0x00100000
 
#define F_DOWNLOAD   F_RECV_FRAG
 
#define F_ALL   0x001FFFFF
 
#define SK_TERMINATE   0x00000001
 
#define TH_OK   0x01
 
#define TH_TOUT   0x02
 
#define TH_ALL   0x03
 
#define TH_EXECUTE(sig, tout)
 
#define TH_ASSERT(cond)
 
#define TH_ASSERT2(c1, c2, s1, r1, r2)
 
#define ARG_INIT()
 
#define ARG_CREATE(_af, _type, _proto)
 
#define ARG_BIND(_sock, _ip, _ip_len, _port)
 
#define ARG_LISTEN(_sock, _backlog)
 
#define ARG_ACCEPT(_sock, _ip, _ip_len, _port)
 
#define TEST_PORT   2000
 
#define TEST_PORT_NB   2001
 
#define CMD_CONNECT_TCP   "CONNECT TCP,0.0.0.0,2000,500"
 
#define CMD_CONNECT_UDP   "CONNECT UDP,0.0.0.0,2000,200"
 
#define CMD_CONNECT_TCP_NB   "CONNECT TCP,0.0.0.0,2001,500"
 
#define ARG_CONNECT(_sock, _ip, _ip_len, _port)
 
#define ARG_RECV(_sock, _buf, _len)
 
#define ARG_RECVFROM(_sock, _buf, _len, _ip, _ip_len, _port)
 
#define ARG_SEND(_sock, _buf, _len)
 
#define ARG_SENDTO(_sock, _buf, _len, _ip, _ip_len, _port)
 
#define ARG_GETSOCKNAME(_sock, _ip, _ip_len, _port)
 
#define ARG_GETPEERNAME(_sock, _ip, _ip_len, _port)
 
#define ARG_GETOPT(_sock, _opt_id, _opt_val, _opt_len)
 
#define ARG_SETOPT(_sock, _opt_id, _opt_val, _opt_len)
 
#define ARG_CLOSE(_sock)
 
#define ARG_GETHOST(_name, _af, _ip, _ip_len)
 
#define ARG_PING(_ip, _ip_len)
 
#define ARG_TRANSFER(_sock, _len, _size)
 
#define CMD_SEND_TCP   "SEND TCP,1420,4000"
 
#define CMD_RECV_TCP   "RECV TCP,1420"
 
#define TEST_BSIZE   1420
 

Functions

ARM_DRIVER_WIFI ARM_Driver_WiFi_ (DRV_WIFI)
 
static char data_buf[128] __ALIGNED (4)
 
static void WIFI_DrvEvent (uint32_t evt, void *arg)
 
static int32_t init_and_power_on (void)
 
void WIFI_DV_Initialize (void)
 
void WIFI_DV_Uninitialize (void)
 
void WIFI_GetVersion (void)
 Function: WIFI_GetVersion. More...
 
void WIFI_GetCapabilities (void)
 Function: WIFI_GetCapabilities. More...
 
void WIFI_Initialize_Uninitialize (void)
 Function: WIFI_Initialize/Uninitialize. More...
 
void WIFI_PowerControl (void)
 Function: WIFI_PowerControl. More...
 
void WIFI_GetModuleInfo (void)
 Function: WIFI_GetModuleInfo. More...
 
void WIFI_SetOption_GetOption (void)
 Function: WIFI_SetOption_GetOption. More...
 
void WIFI_Scan (void)
 Function: WIFI_Scan. More...
 
void WIFI_Activate_Deactivate (void)
 Function: WIFI_Activate_Deactivate. More...
 
void WIFI_IsConnected (void)
 Function: WIFI_IsConnected. More...
 
void WIFI_GetNetInfo (void)
 Function: WIFI_GetNetInfo. More...
 
void WIFI_Activate_AP (void)
 Function: WIFI_Activate_AP. More...
 
void WIFI_Activate_Station_WPS_PBC (void)
 Function: WIFI_Activate_Station_WPS_PBC. More...
 
void WIFI_Activate_Station_WPS_PIN (void)
 Function: WIFI_Activate_Station_WPS_PIN. More...
 
void WIFI_Activate_AP_WPS_PBC (void)
 Function: WIFI_Activate_AP_WPS_PBC. More...
 
void WIFI_Activate_AP_WPS_PIN (void)
 Function: WIFI_Activate_AP_WPS_PIN. More...
 
static int32_t station_init (uint32_t con)
 
static void station_uninit (void)
 
static int32_t th_execute (osThreadId_t *id, uint32_t sig, uint32_t tout)
 
static void th_assert2_msg (const char *s1, int32_t r1, int32_t r2)
 
static __NO_RETURN void Th_Create (IO_CREATE *io)
 
void WIFI_SocketCreate (void)
 Function: WIFI_SocketCreate. More...
 
static __NO_RETURN void Th_Bind (IO_BIND *io)
 
void WIFI_SocketBind (void)
 Function: WIFI_SocketBind. More...
 
static __NO_RETURN void Th_Listen (IO_LISTEN *io)
 
void WIFI_SocketListen (void)
 Function: WIFI_SocketListen. More...
 
static __NO_RETURN void Th_Accept (IO_ACCEPT *io)
 
void WIFI_SocketAccept (void)
 Function: WIFI_SocketAccept. More...
 
void WIFI_SocketAccept_nbio (void)
 Test case: WIFI_SocketAccept_nbio. More...
 
static __NO_RETURN void Th_Connect (IO_CONNECT *io)
 
void WIFI_SocketConnect (void)
 Function: WIFI_SocketConnect. More...
 
void WIFI_SocketConnect_nbio (void)
 Test case: WIFI_SocketConnect_nbio. More...
 
static __NO_RETURN void Th_Recv (IO_RECV *io)
 
void WIFI_SocketRecv (void)
 Function: WIFI_SocketRecv. More...
 
void WIFI_SocketRecv_nbio (void)
 Test case: WIFI_SocketRecv_nbio. More...
 
static __NO_RETURN void Th_RecvFrom (IO_RECVFROM *io)
 
void WIFI_SocketRecvFrom (void)
 Function: WIFI_SocketRecvFrom. More...
 
void WIFI_SocketRecvFrom_nbio (void)
 Test case: WIFI_SocketRecvFrom_nbio. More...
 
static __NO_RETURN void Th_Send (IO_SEND *io)
 
void WIFI_SocketSend (void)
 Function: WIFI_SocketSend. More...
 
static __NO_RETURN void Th_SendTo (IO_SENDTO *io)
 
void WIFI_SocketSendTo (void)
 Function: WIFI_SocketSendTo. More...
 
static __NO_RETURN void Th_GetSockName (IO_GETSOCKNAME *io)
 
void WIFI_SocketGetSockName (void)
 Function: WIFI_SocketGetSockName. More...
 
static __NO_RETURN void Th_GetPeerName (IO_GETPEERNAME *io)
 
void WIFI_SocketGetPeerName (void)
 Function: WIFI_SocketGetPeerName. More...
 
static __NO_RETURN void Th_GetOpt (IO_GETOPT *io)
 
void WIFI_SocketGetOpt (void)
 Function: WIFI_SocketGetOpt. More...
 
static __NO_RETURN void Th_SetOpt (IO_SETOPT *io)
 
void WIFI_SocketSetOpt (void)
 Function: WIFI_SocketSetOpt. More...
 
static __NO_RETURN void Th_Close (IO_CLOSE *io)
 
void WIFI_SocketClose (void)
 Function: WIFI_SocketClose. More...
 
static __NO_RETURN void Th_GetHostByName (IO_GETHOST *io)
 
void WIFI_SocketGetHostByName (void)
 Function: WIFI_SocketGetHostByName. More...
 
static __NO_RETURN void Th_Ping (IO_PING *io)
 
void WIFI_Ping (void)
 Function: WIFI_Ping. More...
 
static __NO_RETURN void Th_Transfer (IO_TRANSFER *io)
 
void WIFI_Transfer_Fixed (void)
 Function: WIFI_Transfer_Fixed. More...
 
void WIFI_Transfer_Incremental (void)
 Function: WIFI_Transfer_Incremental. More...
 
void WIFI_Send_Fragmented (void)
 Function: WIFI_Send_Fragmented. More...
 
void WIFI_Recv_Fragmented (void)
 Function: WIFI_Recv_Fragmented. More...
 
void WIFI_Test_Speed (void)
 Function: WIFI_Test_Speed. More...
 
static __NO_RETURN void Th_Sidekick (IO_SIDEKICK *io2)
 
void WIFI_Concurrent_Socket (void)
 Function: WIFI_Concurrent_Socket. More...
 
static __NO_RETURN void Th_StreamRate (IO_STREAMRATE *io)
 
void WIFI_Downstream_Rate (void)
 Function: WIFI_Downstream_Rate. More...
 
void WIFI_Upstream_Rate (void)
 Function: WIFI_Upstream_Rate. More...
 

Variables

static ARM_DRIVER_WIFI * drv = &ARM_Driver_WiFi_(DRV_WIFI)
 
static uint8_t powered = 0U
 
static uint8_t connected = 0U
 
static uint8_t socket_funcs_exist = 0U
 
static char msg_buf [128]
 
static ARM_WIFI_SignalEvent_t event_func
 
static ARM_WIFI_CAPABILITIES cap
 
static ARM_WIFI_CONFIG_t config
 
static ARM_WIFI_NET_INFO_t net_info
 
static ARM_WIFI_SCAN_INFO_t scan_info [WIFI_SCAN_MAX_NUM]
 
static const uint8_t ip_unspec [4] = { 0, 0, 0, 0 }
 
static const uint8_t ip_bcast [4] = { 255, 255, 255, 255 }
 
static uint8_t ip_socket_server [4]
 
static const char * str_ret []
 
static const char * str_sock_ret []
 
static const uint8_t test_msg [44]
 
static const uint8_t test_buf [2050]
 
static uint8_t buffer [2048]
 

Macro Definition Documentation

#define ECHO_PORT   7
#define DISCARD_PORT   9
#define CHARGEN_PORT   19
#define ASSISTANT_PORT   5000
#define TCP_REJECTED_PORT   5001
#define TCP_TIMEOUT_PORT   5002
#define F_CREATE   0x00000001
#define F_CREATE_TCP   F_CREATE
#define F_CREATE_UDP   0x00000002
#define F_CLOSE   0x00000004
#define F_BIND   0x00000008
#define F_LISTEN   0x00000010
#define F_ACCEPT   0x00000020
#define F_CONNECT   0x00000040
#define F_RECV   0x00000080
#define F_RECVFROM   0x00000100
#define F_SEND   0x00000200
#define F_SENDTO   0x00000400
#define F_GETSOCKNAME   0x00000800
#define F_GETPEERNAME   0x00001000
#define F_GETOPT   0x00002000
#define F_SETOPT   0x00004000
#define F_GETHOSTBYNAME   0x00008000
#define F_PING   0x00010000
#define F_SEND_CTRL   F_PING
#define F_XFER_FIXED   0x00020000
#define F_XFER_INCR   0x00040000
#define F_SEND_FRAG   0x00080000
#define F_UPLOAD   F_SEND_FRAG
#define F_RECV_FRAG   0x00100000
#define F_DOWNLOAD   F_RECV_FRAG
#define F_ALL   0x001FFFFF
#define SK_TERMINATE   0x00000001
#define TH_OK   0x01
#define TH_TOUT   0x02
#define TH_ALL   0x03
#define TH_EXECUTE (   sig,
  tout 
)
Value:
do { \
io.xid++; \
rval = th_execute (worker, sig, tout); \
if (rval == 0) { \
/* Msg was prepared in th_execute function */ \
TEST_ASSERT_MESSAGE(0,msg_buf); \
} \
} while (0)
static int32_t th_execute(osThreadId_t *id, uint32_t sig, uint32_t tout)
Definition: DV_WIFI.c:3022
static char msg_buf[128]
Definition: DV_WIFI.c:102
#define TH_ASSERT (   cond)
Value:
do { \
if (rval) { TEST_ASSERT(cond); } \
} while (0)
#define TH_ASSERT2 (   c1,
  c2,
  s1,
  r1,
  r2 
)
Value:
do { \
if (rval) { \
if (!c2) { TEST_ASSERT(c1); } \
else { \
th_assert2_msg(s1, r1, r2); /* Prep msg */ \
TEST_MESSAGE(msg_buf); \
} \
} \
} while (0)
static char msg_buf[128]
Definition: DV_WIFI.c:102
static void th_assert2_msg(const char *s1, int32_t r1, int32_t r2)
Definition: DV_WIFI.c:3034
#define ARG_INIT ( )
Value:
do { \
io.owner = osThreadGetId (); \
io.xid = 0; \
} while (0)
#define ARG_CREATE (   _af,
  _type,
  _proto 
)
Value:
do { \
io.af = _af; \
io.type = _type; \
io.protocol = _proto; \
} while (0)
#define ARG_BIND (   _sock,
  _ip,
  _ip_len,
  _port 
)
Value:
do { \
io.sock = _sock; \
io.ip = _ip; \
io.ip_len = _ip_len; \
io.port = _port; \
} while (0)
#define ARG_LISTEN (   _sock,
  _backlog 
)
Value:
do { \
io.sock = _sock; \
io.backlog = _backlog; \
} while (0)
#define ARG_ACCEPT (   _sock,
  _ip,
  _ip_len,
  _port 
)
Value:
do { \
io.sock = _sock; \
io.ip = _ip; \
io.ip_len = _ip_len; \
io.port = _port; \
} while (0)
#define TEST_PORT   2000
#define TEST_PORT_NB   2001
#define CMD_CONNECT_TCP   "CONNECT TCP,0.0.0.0,2000,500"
#define CMD_CONNECT_UDP   "CONNECT UDP,0.0.0.0,2000,200"
#define CMD_CONNECT_TCP_NB   "CONNECT TCP,0.0.0.0,2001,500"
#define ARG_CONNECT (   _sock,
  _ip,
  _ip_len,
  _port 
)
Value:
do { \
io.sock = _sock; \
io.ip = _ip; \
io.ip_len = _ip_len; \
io.port = _port; \
} while (0)
#define ARG_RECV (   _sock,
  _buf,
  _len 
)
Value:
do { \
io.sock = _sock; \
io.buf = _buf; \
io.len = _len; \
} while (0)
#define ARG_RECVFROM (   _sock,
  _buf,
  _len,
  _ip,
  _ip_len,
  _port 
)
Value:
do { \
io.sock = _sock; \
io.buf = _buf; \
io.len = _len; \
io.ip = _ip; \
io.ip_len = _ip_len; \
io.port = _port; \
} while (0)
#define ARG_SEND (   _sock,
  _buf,
  _len 
)
Value:
do { \
io.sock = _sock; \
io.buf = _buf; \
io.len = _len; \
} while (0)
#define ARG_SENDTO (   _sock,
  _buf,
  _len,
  _ip,
  _ip_len,
  _port 
)
Value:
do { \
io.sock = _sock; \
io.buf = _buf; \
io.len = _len; \
io.ip = _ip; \
io.ip_len = _ip_len; \
io.port = _port; \
} while (0)
#define ARG_GETSOCKNAME (   _sock,
  _ip,
  _ip_len,
  _port 
)
Value:
do { \
io.sock = _sock; \
io.ip = _ip; \
io.ip_len = _ip_len; \
io.port = _port; \
} while (0)
#define ARG_GETPEERNAME (   _sock,
  _ip,
  _ip_len,
  _port 
)
Value:
do { \
io.sock = _sock; \
io.ip = _ip; \
io.ip_len = _ip_len; \
io.port = _port; \
} while (0)
#define ARG_GETOPT (   _sock,
  _opt_id,
  _opt_val,
  _opt_len 
)
Value:
do { \
io.sock = _sock; \
io.opt_id = _opt_id; \
io.opt_val = _opt_val; \
io.opt_len = _opt_len; \
} while (0)
#define ARG_SETOPT (   _sock,
  _opt_id,
  _opt_val,
  _opt_len 
)
Value:
do { \
io.sock = _sock; \
io.opt_id = _opt_id; \
io.opt_val = _opt_val; \
io.opt_len = _opt_len; \
} while (0)
#define ARG_CLOSE (   _sock)
Value:
do { \
io.sock = _sock; \
} while (0)
#define ARG_GETHOST (   _name,
  _af,
  _ip,
  _ip_len 
)
Value:
do { \
io.name = _name; \
io.af = _af; \
io.ip = _ip; \
io.ip_len = _ip_len; \
} while (0)
#define ARG_PING (   _ip,
  _ip_len 
)
Value:
do { \
io.ip = _ip; \
io.ip_len = _ip_len; \
} while (0)
#define ARG_TRANSFER (   _sock,
  _len,
  _size 
)
Value:
do { \
io.sock = _sock; \
io.len = _len; \
io.size = _size; \
} while (0)
#define CMD_SEND_TCP   "SEND TCP,1420,4000"
#define CMD_RECV_TCP   "RECV TCP,1420"
#define TEST_BSIZE   1420

Function Documentation

ARM_DRIVER_WIFI ARM_Driver_WiFi_ ( DRV_WIFI  )
static char data_buf [128] __ALIGNED ( )
static
static void WIFI_DrvEvent ( uint32_t  evt,
void *  arg 
)
static
static int32_t init_and_power_on ( void  )
static
void WIFI_DV_Initialize ( void  )
void WIFI_DV_Uninitialize ( void  )
static int32_t station_init ( uint32_t  con)
static
static void station_uninit ( void  )
static
static int32_t th_execute ( osThreadId_t *  id,
uint32_t  sig,
uint32_t  tout 
)
static
static void th_assert2_msg ( const char *  s1,
int32_t  r1,
int32_t  r2 
)
static
static __NO_RETURN void Th_Create ( IO_CREATE *  io)
static
static __NO_RETURN void Th_Bind ( IO_BIND *  io)
static
static __NO_RETURN void Th_Listen ( IO_LISTEN *  io)
static
static __NO_RETURN void Th_Accept ( IO_ACCEPT *  io)
static
static __NO_RETURN void Th_Connect ( IO_CONNECT *  io)
static
static __NO_RETURN void Th_Recv ( IO_RECV *  io)
static
static __NO_RETURN void Th_RecvFrom ( IO_RECVFROM *  io)
static
static __NO_RETURN void Th_Send ( IO_SEND *  io)
static
static __NO_RETURN void Th_SendTo ( IO_SENDTO *  io)
static
static __NO_RETURN void Th_GetSockName ( IO_GETSOCKNAME *  io)
static
static __NO_RETURN void Th_GetPeerName ( IO_GETPEERNAME *  io)
static
static __NO_RETURN void Th_GetOpt ( IO_GETOPT *  io)
static
static __NO_RETURN void Th_SetOpt ( IO_SETOPT *  io)
static
static __NO_RETURN void Th_Close ( IO_CLOSE *  io)
static
static __NO_RETURN void Th_GetHostByName ( IO_GETHOST *  io)
static
static __NO_RETURN void Th_Ping ( IO_PING *  io)
static
static __NO_RETURN void Th_Transfer ( IO_TRANSFER *  io)
static
static __NO_RETURN void Th_Sidekick ( IO_SIDEKICK *  io2)
static
static __NO_RETURN void Th_StreamRate ( IO_STREAMRATE *  io)
static

Variable Documentation

ARM_DRIVER_WIFI* drv = &ARM_Driver_WiFi_(DRV_WIFI)
static
uint8_t powered = 0U
static
uint8_t connected = 0U
static
uint8_t socket_funcs_exist = 0U
static
char msg_buf[128]
static
ARM_WIFI_SignalEvent_t event_func
static
ARM_WIFI_CAPABILITIES cap
static
ARM_WIFI_CONFIG_t config
static
ARM_WIFI_NET_INFO_t net_info
static
ARM_WIFI_SCAN_INFO_t scan_info[WIFI_SCAN_MAX_NUM]
static
const uint8_t ip_unspec[4] = { 0, 0, 0, 0 }
static
const uint8_t ip_bcast[4] = { 255, 255, 255, 255 }
static
uint8_t ip_socket_server[4]
static
const char* str_ret[]
static
Initial value:
= {
"ARM_DRIVER_OK",
"ARM_DRIVER_ERROR",
"ARM_DRIVER_ERROR_BUSY",
"ARM_DRIVER_ERROR_TIMEOUT",
"ARM_DRIVER_ERROR_UNSUPPORTED",
"ARM_DRIVER_ERROR_PARAMETER",
"ARM_DRIVER_ERROR_SPECIFIC"
}
const char* str_sock_ret[]
static
Initial value:
= {
"OK",
"ARM_SOCKET_ERROR",
"ARM_SOCKET_ESOCK",
"ARM_SOCKET_EINVAL",
"ARM_SOCKET_ENOTSUP",
"ARM_SOCKET_ENOMEM",
"ARM_SOCKET_EAGAIN",
"ARM_SOCKET_EINPROGRESS",
"ARM_SOCKET_ETIMEDOUT",
"ARM_SOCKET_EISCONN",
"ARM_SOCKET_ENOTCONN",
"ARM_SOCKET_ECONNREFUSED",
"ARM_SOCKET_ECONNRESET",
"ARM_SOCKET_ECONNABORTED",
"ARM_SOCKET_EALREADY",
"ARM_SOCKET_EADDRINUSE",
"ARM_SOCKET_EHOSTNOTFOUND"
}
const uint8_t test_msg[44]
static
Initial value:
= {
"The quick brown fox jumps over the lazy dog."
}
const uint8_t test_buf[2050]
static
uint8_t buffer[2048]
static