esp_wifi_netdev.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2019 Gunar Schorcht
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
18 #include <stdbool.h>
19 
20 #include "mutex.h"
21 #include "net/ethernet.h"
22 #include "net/netdev.h"
23 #include "ringbuffer.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
32 #ifndef ESP_WIFI_BUFSIZE
33 #define ESP_WIFI_BUFSIZE (ETHERNET_MAX_LEN << 1)
34 #endif
35 
39 extern const netdev_driver_t esp_wifi_driver;
40 
44 typedef struct
45 {
48  uint8_t rx_mem[ESP_WIFI_BUFSIZE];
51  uint16_t tx_len;
52  uint8_t tx_buf[ETHERNET_MAX_LEN];
54  uint8_t event_recv;
55 #ifdef MODULE_ESP_WIFI_AP
56  uint8_t sta_connected;
57 #else /* MODULE_ESP_WIFI_AP */
58  uint8_t event_conn;
59  uint8_t event_disc;
61  bool connected;
62 #endif /* MODULE_ESP_WIFI_AP */
63 
67 
68 #ifdef __cplusplus
69 }
70 #endif
71 
Definitions low-level network driver interface.
#define ESP_WIFI_BUFSIZE
Buffer size used for RX buffering.
const netdev_driver_t esp_wifi_driver
Reference to the netdev device driver struct.
Definitions for Ethernet.
#define ETHERNET_MAX_LEN
maximum number of bytes in an ethernet frame (with FCF)
Definition: ethernet.h:46
Mutex for thread synchronization.
A utility for storing and retrieving byte data using a ring buffer.
Device descriptor for ESP WiFi devices.
uint16_t tx_len
number of bytes in transmit buffer
netdev_t netdev
netdev parent struct
uint8_t event_conn
number of pending connect events
ringbuffer_t rx_buf
ringbuffer for incoming packages
uint8_t event_recv
number of frame received events
mutex_t dev_lock
device is already in use
uint8_t event_disc
number of pending disc events
bool connected
indicates whether connected to AP
Mutex structure.
Definition: mutex.h:39
Structure to hold driver interface -> function mapping.
Definition: netdev.h:426
Structure to hold driver state.
Definition: netdev.h:365
Ringbuffer.
Definition: ringbuffer.h:35