ESP32-IDF
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
tcpip_adapter.h File Reference
#include <stdint.h>
#include "rom/queue.h"
#include "esp_wifi.h"
#include "lwip/ip_addr.h"
#include "apps/dhcpserver.h"

Go to the source code of this file.

Data Structures

struct  tcpip_adapter_ip_info_t
 
struct  station_list
 

Macros

#define CONFIG_TCPIP_LWIP   1
 
#define CONFIG_DHCP_STA_LIST   1
 
#define IP2STR(ipaddr)
 
#define IPSTR   "%d.%d.%d.%d"
 
#define ESP_ERR_TCPIP_ADAPTER_BASE   0x5000
 
#define ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS   ESP_ERR_TCPIP_ADAPTER_BASE + 0x00
 
#define ESP_ERR_TCPIP_ADAPTER_IF_NOT_READY   ESP_ERR_TCPIP_ADAPTER_BASE + 0x01
 
#define ESP_ERR_TCPIP_ADAPTER_DHCPC_START_FAILED   ESP_ERR_TCPIP_ADAPTER_BASE + 0x02
 
#define ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STARTED   ESP_ERR_TCPIP_ADAPTER_BASE + 0x03
 
#define ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STOPPED   ESP_ERR_TCPIP_ADAPTER_BASE + 0x04
 
#define ESP_ERR_TCPIP_ADAPTER_NO_MEM   ESP_ERR_TCPIP_ADAPTER_BASE + 0x05
 
#define ESP_ERR_TCPIP_ADAPTER_DHCP_NOT_STOPPED   ESP_ERR_TCPIP_ADAPTER_BASE + 0x06
 

Typedefs

typedef dhcps_lease_t tcpip_adapter_dhcps_lease_t
 

Enumerations

enum  tcpip_adapter_if_t { TCPIP_ADAPTER_IF_STA = 0, TCPIP_ADAPTER_IF_AP, TCPIP_ADAPTER_IF_MAX }
 
enum  tcpip_adapter_dhcp_status_t { TCPIP_ADAPTER_DHCP_INIT = 0, TCPIP_ADAPTER_DHCP_STARTED, TCPIP_ADAPTER_DHCP_STOPPED, TCPIP_ADAPTER_DHCP_STATUS_MAX }
 
enum  tcpip_adapter_option_mode_t { TCPIP_ADAPTER_OP_START = 0, TCPIP_ADAPTER_OP_SET, TCPIP_ADAPTER_OP_GET, TCPIP_ADAPTER_OP_MAX }
 
enum  tcpip_adapter_option_id_t { TCPIP_ADAPTER_ROUTER_SOLICITATION_ADDRESS = 32, TCPIP_ADAPTER_REQUESTED_IP_ADDRESS = 50, TCPIP_ADAPTER_IP_ADDRESS_LEASE_TIME = 51, TCPIP_ADAPTER_IP_REQUEST_RETRY_TIME = 52 }
 

Functions

void tcpip_adapter_init (void)
 
esp_err_t tcpip_adapter_start (tcpip_adapter_if_t tcpip_if, uint8_t *mac, tcpip_adapter_ip_info_t *ip_info)
 
esp_err_t tcpip_adapter_stop (tcpip_adapter_if_t tcpip_if)
 
esp_err_t tcpip_adapter_up (tcpip_adapter_if_t tcpip_if)
 
esp_err_t tcpip_adapter_down (tcpip_adapter_if_t tcpip_if)
 
esp_err_t tcpip_adapter_get_ip_info (tcpip_adapter_if_t tcpip_if, tcpip_adapter_ip_info_t *ip_info)
 
esp_err_t tcpip_adapter_set_ip_info (tcpip_adapter_if_t tcpip_if, tcpip_adapter_ip_info_t *ip_info)
 
esp_err_t tcpip_adapter_dhcps_get_status (tcpip_adapter_if_t tcpip_if, tcpip_adapter_dhcp_status_t *status)
 
esp_err_t tcpip_adapter_dhcps_option (tcpip_adapter_option_mode_t opt_op, tcpip_adapter_option_id_t opt_id, void *opt_val, uint32_t opt_len)
 
esp_err_t tcpip_adapter_dhcps_start (tcpip_adapter_if_t tcpip_if)
 
esp_err_t tcpip_adapter_dhcps_stop (tcpip_adapter_if_t tcpip_if)
 
esp_err_t tcpip_adapter_dhcpc_get_status (tcpip_adapter_if_t tcpip_if, tcpip_adapter_dhcp_status_t *status)
 
esp_err_t tcpip_adapter_dhcpc_option (tcpip_adapter_option_mode_t opt_op, tcpip_adapter_option_id_t opt_id, void *opt_val, uint32_t opt_len)
 
esp_err_t tcpip_adapter_dhcpc_start (tcpip_adapter_if_t tcpip_if)
 
esp_err_t tcpip_adapter_dhcpc_stop (tcpip_adapter_if_t tcpip_if)
 
esp_err_t tcpip_adapter_sta_input (void *buffer, uint16_t len, void *eb)
 
esp_err_t tcpip_adapter_ap_input (void *buffer, uint16_t len, void *eb)
 
wifi_interface_t tcpip_adapter_get_wifi_if (void *dev)
 
esp_err_t tcpip_adapter_get_sta_list (struct station_info *sta_info, struct station_list **sta_list)
 
esp_err_t tcpip_adapter_free_sta_list (struct station_list *sta_list)
 

Macro Definition Documentation

#define CONFIG_DHCP_STA_LIST   1
#define CONFIG_TCPIP_LWIP   1
#define ESP_ERR_TCPIP_ADAPTER_BASE   0x5000
#define ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STARTED   ESP_ERR_TCPIP_ADAPTER_BASE + 0x03
#define ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STOPPED   ESP_ERR_TCPIP_ADAPTER_BASE + 0x04
#define ESP_ERR_TCPIP_ADAPTER_DHCP_NOT_STOPPED   ESP_ERR_TCPIP_ADAPTER_BASE + 0x06
#define ESP_ERR_TCPIP_ADAPTER_DHCPC_START_FAILED   ESP_ERR_TCPIP_ADAPTER_BASE + 0x02
#define ESP_ERR_TCPIP_ADAPTER_IF_NOT_READY   ESP_ERR_TCPIP_ADAPTER_BASE + 0x01
#define ESP_ERR_TCPIP_ADAPTER_INVALID_PARAMS   ESP_ERR_TCPIP_ADAPTER_BASE + 0x00
#define ESP_ERR_TCPIP_ADAPTER_NO_MEM   ESP_ERR_TCPIP_ADAPTER_BASE + 0x05
#define IP2STR (   ipaddr)
Value:
ip4_addr1_16(ipaddr), \
ip4_addr2_16(ipaddr), \
ip4_addr3_16(ipaddr), \
ip4_addr4_16(ipaddr)
#define IPSTR   "%d.%d.%d.%d"

Typedef Documentation

Enumeration Type Documentation

Enumerator
TCPIP_ADAPTER_DHCP_INIT 
TCPIP_ADAPTER_DHCP_STARTED 
TCPIP_ADAPTER_DHCP_STOPPED 
TCPIP_ADAPTER_DHCP_STATUS_MAX 
Enumerator
TCPIP_ADAPTER_IF_STA 

ESP32 station interface

TCPIP_ADAPTER_IF_AP 

ESP32 soft-AP interface

TCPIP_ADAPTER_IF_MAX 
Enumerator
TCPIP_ADAPTER_ROUTER_SOLICITATION_ADDRESS 
TCPIP_ADAPTER_REQUESTED_IP_ADDRESS 
TCPIP_ADAPTER_IP_ADDRESS_LEASE_TIME 
TCPIP_ADAPTER_IP_REQUEST_RETRY_TIME 
Enumerator
TCPIP_ADAPTER_OP_START 
TCPIP_ADAPTER_OP_SET 
TCPIP_ADAPTER_OP_GET 
TCPIP_ADAPTER_OP_MAX 

Function Documentation

esp_err_t tcpip_adapter_ap_input ( void buffer,
uint16_t  len,
void eb 
)
esp_err_t tcpip_adapter_dhcpc_get_status ( tcpip_adapter_if_t  tcpip_if,
tcpip_adapter_dhcp_status_t status 
)
esp_err_t tcpip_adapter_dhcpc_option ( tcpip_adapter_option_mode_t  opt_op,
tcpip_adapter_option_id_t  opt_id,
void opt_val,
uint32_t  opt_len 
)
esp_err_t tcpip_adapter_dhcpc_start ( tcpip_adapter_if_t  tcpip_if)
esp_err_t tcpip_adapter_dhcpc_stop ( tcpip_adapter_if_t  tcpip_if)
esp_err_t tcpip_adapter_dhcps_get_status ( tcpip_adapter_if_t  tcpip_if,
tcpip_adapter_dhcp_status_t status 
)
esp_err_t tcpip_adapter_dhcps_option ( tcpip_adapter_option_mode_t  opt_op,
tcpip_adapter_option_id_t  opt_id,
void opt_val,
uint32_t  opt_len 
)
esp_err_t tcpip_adapter_dhcps_start ( tcpip_adapter_if_t  tcpip_if)
esp_err_t tcpip_adapter_dhcps_stop ( tcpip_adapter_if_t  tcpip_if)
esp_err_t tcpip_adapter_down ( tcpip_adapter_if_t  tcpip_if)
esp_err_t tcpip_adapter_free_sta_list ( struct station_list sta_list)
esp_err_t tcpip_adapter_get_ip_info ( tcpip_adapter_if_t  tcpip_if,
tcpip_adapter_ip_info_t ip_info 
)
esp_err_t tcpip_adapter_get_sta_list ( struct station_info sta_info,
struct station_list **  sta_list 
)
wifi_interface_t tcpip_adapter_get_wifi_if ( void dev)
void tcpip_adapter_init ( void  )
esp_err_t tcpip_adapter_set_ip_info ( tcpip_adapter_if_t  tcpip_if,
tcpip_adapter_ip_info_t ip_info 
)
esp_err_t tcpip_adapter_sta_input ( void buffer,
uint16_t  len,
void eb 
)
esp_err_t tcpip_adapter_start ( tcpip_adapter_if_t  tcpip_if,
uint8_t mac,
tcpip_adapter_ip_info_t ip_info 
)
esp_err_t tcpip_adapter_stop ( tcpip_adapter_if_t  tcpip_if)
esp_err_t tcpip_adapter_up ( tcpip_adapter_if_t  tcpip_if)