mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-05 05:34:32 +02:00
lwip: fix build with CONFIG_LWIP_DHCPS disabled
Also added example build configuration for this option.
This commit is contained in:
@@ -42,6 +42,8 @@ typedef struct {
|
|||||||
/**
|
/**
|
||||||
* @brief Get IP information for stations connected to the Wi-Fi AP interface
|
* @brief Get IP information for stations connected to the Wi-Fi AP interface
|
||||||
*
|
*
|
||||||
|
* @note If `CONFIG_LWIP_DHCPS` is disabled then `ip` address field will not be populated in sta list
|
||||||
|
*
|
||||||
* @warning This API works only for the default Wi-Fi AP interface, i.e. esp-netif with key="WIFI_AP_DEF"
|
* @warning This API works only for the default Wi-Fi AP interface, i.e. esp-netif with key="WIFI_AP_DEF"
|
||||||
*
|
*
|
||||||
* @param[in] wifi_sta_list Wi-Fi station info list, returned from esp_wifi_ap_get_sta_list()
|
* @param[in] wifi_sta_list Wi-Fi station info list, returned from esp_wifi_ap_get_sta_list()
|
||||||
|
@@ -29,7 +29,9 @@ esp_err_t esp_netif_get_sta_list(const wifi_sta_list_t *wifi_sta_list, esp_netif
|
|||||||
netif_sta_list->num = wifi_sta_list->num;
|
netif_sta_list->num = wifi_sta_list->num;
|
||||||
for (int i = 0; i < wifi_sta_list->num; i++) {
|
for (int i = 0; i < wifi_sta_list->num; i++) {
|
||||||
memcpy(netif_sta_list->sta[i].mac, wifi_sta_list->sta[i].mac, 6);
|
memcpy(netif_sta_list->sta[i].mac, wifi_sta_list->sta[i].mac, 6);
|
||||||
|
#if CONFIG_LWIP_DHCPS
|
||||||
dhcp_search_ip_on_mac(ap->dhcps, netif_sta_list->sta[i].mac, (ip4_addr_t*)&netif_sta_list->sta[i].ip);
|
dhcp_search_ip_on_mac(ap->dhcps, netif_sta_list->sta[i].mac, (ip4_addr_t*)&netif_sta_list->sta[i].ip);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
|
@@ -2,3 +2,4 @@ CONFIG_EXAMPLE_IPV4=y
|
|||||||
CONFIG_EXAMPLE_IPV6=n
|
CONFIG_EXAMPLE_IPV6=n
|
||||||
CONFIG_EXAMPLE_CONNECT_IPV6=n
|
CONFIG_EXAMPLE_CONNECT_IPV6=n
|
||||||
CONFIG_LWIP_IPV6=n
|
CONFIG_LWIP_IPV6=n
|
||||||
|
CONFIG_LWIP_DHCPS=n
|
||||||
|
Reference in New Issue
Block a user