fix(esp_wifi_remote): Build issue for softAP

This commit is contained in:
Yogesh Mantri 2024-04-08 20:11:08 +08:00
parent 3698d0a408
commit a3abdb9176
2 changed files with 12 additions and 3 deletions

View File

@ -47,7 +47,8 @@ else()
# No local wifi: provide only netif bindings
set(srcs
"src/wifi_default.c"
"src/wifi_netif.c")
"src/wifi_netif.c"
"src/wifi_default_ap.c")
set(local_include_dirs)
endif()

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -8,10 +8,15 @@
#include "esp_log.h"
#include "esp_netif.h"
#include "esp_wifi_ap_get_sta_list.h"
#if __has_include("esp_wifi_types_native.h")
// We can only support the actual implementation of esp_wifi_ap_get_sta_list_with_ip() if the wifi native types are available
// - could be local wifi or using remote wifi (if neither is available we just return ESP_ERR_NOT_SUPPORTED)
#define WIFI_NATIVE_TYPES_AVAILABLE
#endif
esp_err_t esp_wifi_ap_get_sta_list_with_ip(const wifi_sta_list_t *wifi_sta_list, wifi_sta_mac_ip_list_t *wifi_sta_ip_mac_list)
{
#ifdef WIFI_NATIVE_TYPES_AVAILABLE
if ((wifi_sta_list == NULL) || (wifi_sta_ip_mac_list == NULL)) {
return ESP_ERR_ESP_NETIF_INVALID_PARAMS;
}
@ -26,4 +31,7 @@ esp_err_t esp_wifi_ap_get_sta_list_with_ip(const wifi_sta_list_t *wifi_sta_list,
memset(&wifi_sta_ip_mac_list->sta[i].ip, 0, sizeof(esp_ip4_addr_t));
}
return esp_netif_dhcps_get_clients_by_mac(ap, num, wifi_sta_ip_mac_list->sta);
#else
return ESP_ERR_NOT_SUPPORTED;
#endif
}