Classes | Macros | Typedefs | Functions | Variables
wifi.c File Reference
#include <asf.h>
#include <string.h>
#include "wifi.h"
#include "driver/include/m2m_wifi.h"
#include "driver/source/nmasic.h"
#include "common/include/nm_common.h"
#include "socket/include/socket.h"
#include "globals.h"
Include dependency graph for wifi.c:

Go to the source code of this file.

Classes

struct  s_msg_wifi_product
 

Macros

#define MAIN_WIFI_M2M_PRODUCT_NAME   "EVB-2"
 
#define WIFI_AUTH   M2M_WIFI_SEC_WPA_PSK
 
#define WIFI_BUFFER_SIZE   1460
 

Typedefs

typedef struct s_msg_wifi_product t_msg_wifi_product
 

Functions

static void deinit_tcp_socket (void)
 
static void deinit_wifi (void)
 
static void init_tcp_socket (void)
 
static void init_wifi (void)
 
static void socket_cb (SOCKET sock, uint8_t u8Msg, void *pvMsg)
 Callback to get the Data from socket. More...
 
static void step_wifi (rtos_task_t *task)
 
static void update_wifi_leds (rtos_task_t *task)
 
void vTaskWiFi (void *pvParameters)
 
static void wifi_cb (uint8_t u8MsgType, void *pvMsg)
 Callback to get the Wi-Fi status update. More...
 
void wifi_enable (int enable)
 
void wifi_reinit (void)
 

Variables

static struct sockaddr_in g_addr = {0}
 
static int g_indicateWiFiRxMs =0
 
static int g_init_wifi = 0
 
static uint8_t g_wifi_connected = 0
 
StreamBufferHandle_t g_xStreamBufferWiFiRx
 
StreamBufferHandle_t g_xStreamBufferWiFiTx
 
static t_msg_wifi_product msg_wifi_product
 
static uint8_t socketRxBuffer [WIFI_BUFFER_SIZE]
 
static uint8_t socketTxBuffer [WIFI_BUFFER_SIZE]
 
static SOCKET tcp_client_socket = -1
 

Macro Definition Documentation

◆ MAIN_WIFI_M2M_PRODUCT_NAME

#define MAIN_WIFI_M2M_PRODUCT_NAME   "EVB-2"

Definition at line 22 of file wifi.c.

◆ WIFI_AUTH

#define WIFI_AUTH   M2M_WIFI_SEC_WPA_PSK

Definition at line 21 of file wifi.c.

◆ WIFI_BUFFER_SIZE

#define WIFI_BUFFER_SIZE   1460

Receive buffer definition.

Definition at line 53 of file wifi.c.

Typedef Documentation

◆ t_msg_wifi_product

Message format definitions.

Function Documentation

◆ deinit_tcp_socket()

static void deinit_tcp_socket ( void  )
static

Definition at line 225 of file wifi.c.

◆ deinit_wifi()

static void deinit_wifi ( void  )
static

Definition at line 297 of file wifi.c.

◆ init_tcp_socket()

static void init_tcp_socket ( void  )
static

Definition at line 211 of file wifi.c.

◆ init_wifi()

static void init_wifi ( void  )
static

Definition at line 258 of file wifi.c.

◆ socket_cb()

static void socket_cb ( SOCKET  sock,
uint8_t  u8Msg,
void *  pvMsg 
)
static

Callback to get the Data from socket.

Parameters
[in]socksocket handler.
[in]u8Msgsocket event type. Possible values are:
  • SOCKET_MSG_BIND
  • SOCKET_MSG_LISTEN
  • SOCKET_MSG_ACCEPT
  • SOCKET_MSG_CONNECT
  • SOCKET_MSG_RECV
  • SOCKET_MSG_SEND
  • SOCKET_MSG_SENDTO
  • SOCKET_MSG_RECVFROM
[in]pvMsgis a pointer to message structure. Existing types are:

Definition at line 144 of file wifi.c.

◆ step_wifi()

static void step_wifi ( rtos_task_t task)
static

Definition at line 335 of file wifi.c.

◆ update_wifi_leds()

static void update_wifi_leds ( rtos_task_t task)
static

Definition at line 311 of file wifi.c.

◆ vTaskWiFi()

void vTaskWiFi ( void *  pvParameters)

Definition at line 395 of file wifi.c.

◆ wifi_cb()

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:

Definition at line 84 of file wifi.c.

◆ wifi_enable()

void wifi_enable ( int  enable)

Definition at line 236 of file wifi.c.

◆ wifi_reinit()

void wifi_reinit ( void  )

Definition at line 252 of file wifi.c.

Variable Documentation

◆ g_addr

struct sockaddr_in g_addr = {0}
static

Definition at line 41 of file wifi.c.

◆ g_indicateWiFiRxMs

int g_indicateWiFiRxMs =0
static

Definition at line 56 of file wifi.c.

◆ g_init_wifi

int g_init_wifi = 0
static

Definition at line 38 of file wifi.c.

◆ g_wifi_connected

uint8_t g_wifi_connected = 0
static

Definition at line 39 of file wifi.c.

◆ g_xStreamBufferWiFiRx

StreamBufferHandle_t g_xStreamBufferWiFiRx

Definition at line 46 of file communications.cpp.

◆ g_xStreamBufferWiFiTx

StreamBufferHandle_t g_xStreamBufferWiFiTx

Definition at line 47 of file communications.cpp.

◆ msg_wifi_product

t_msg_wifi_product msg_wifi_product
static
Initial value:
= {
}
#define MAIN_WIFI_M2M_PRODUCT_NAME
Definition: wifi.c:22

Definition at line 48 of file wifi.c.

◆ socketRxBuffer

uint8_t socketRxBuffer[WIFI_BUFFER_SIZE]
static

Definition at line 54 of file wifi.c.

◆ socketTxBuffer

uint8_t socketTxBuffer[WIFI_BUFFER_SIZE]
static

Definition at line 55 of file wifi.c.

◆ tcp_client_socket

SOCKET tcp_client_socket = -1
static

Socket for client

Definition at line 37 of file wifi.c.



inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:18:00