1. Remove ip member of struct station_info

2. Add struct station_list into tcpip_adapter layer
3. When ap -L cmd is received, get mac address from mac layer first and then search ip address based on mac address on dhcp layer.
This commit is contained in:
xiaxiaotian
2016-08-23 11:22:58 +08:00
committed by Wu Jian Gang
parent c35b57ac7b
commit ef0cd1cde3
5 changed files with 91 additions and 0 deletions
@@ -20,15 +20,26 @@
#include "esp_wifi.h"
#define CONFIG_TCPIP_LWIP 1
#define CONFIG_DHCP_STA_LIST 1
#if CONFIG_TCPIP_LWIP
#include "lwip/ip_addr.h"
#include "rom/queue.h"
struct ip_info {
ip4_addr_t ip;
ip4_addr_t netmask;
ip4_addr_t gw;
};
#endif
#if CONFIG_DHCP_STA_LIST
struct station_list {
STAILQ_ENTRY(station_list) next;
uint8_t mac[6];
ip4_addr_t ip;
};
#endif
#define ESP_ERR_TCPIP_ADAPTER_BASE 0x5000 // base should be moved to esp_err.h
@@ -38,6 +49,7 @@ struct ip_info {
#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_STOPED ESP_ERR_TCPIP_ADAPTER_BASE + 0x04
#define ESP_ERR_TCPIP_ADAPTER_NO_MEM ESP_ERR_TCPIP_ADAPTER_BASE + 0x05
/* will add ethernet interface */
typedef enum {
@@ -96,5 +108,8 @@ esp_err_t tcpip_adapter_output(tcpip_adapter_if_t tcpip_if, void *buffer, uint16
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);
#endif /* _TCPIP_ADAPTER_H_ */