1 // Copyright 2019 Espressif Systems (Shanghai) PTE LTD
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef _ESP_NETIF_STA_LIST_H_
16 #define _ESP_NETIF_STA_LIST_H_
17 
18 #include "esp_netif_types.h"
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 /**
25  * @brief station list info element
26  */
27 typedef struct {
28     uint8_t mac[6]; /**< Station MAC address */
29     esp_ip4_addr_t ip;  /**< Station assigned IP address */
30 } esp_netif_sta_info_t;
31 
32 /**
33  * @brief station list structure
34  */
35 typedef struct {
36     esp_netif_sta_info_t sta[ESP_WIFI_MAX_CONN_NUM]; /**< Connected stations */
37     int num; /**< Number of connected stations */
38 } esp_netif_sta_list_t;
39 
40 /**
41  * @defgroup ESP_NETIF_STA_LIST ESP-NETIF STA list api
42  * @brief List of stations for Wi-Fi AP interface
43  *
44  */
45 
46 /** @addtogroup ESP_NETIF_STA_LIST
47  * @{
48  */
49 
50 /**
51  * @brief  Get IP information for stations connected to the Wi-Fi AP interface
52  *
53  * @param[in]   wifi_sta_list Wi-Fi station info list, returned from esp_wifi_ap_get_sta_list()
54  * @param[out]  netif_sta_list IP layer station info list, corresponding to MAC addresses provided in wifi_sta_list
55  *
56  * @return
57  *         - ESP_OK
58  *         - ESP_ERR_ESP_NETIF_NO_MEM
59  *         - ESP_ERR_ESP_NETIF_INVALID_PARAMS
60  */
61 esp_err_t esp_netif_get_sta_list(const wifi_sta_list_t *wifi_sta_list, esp_netif_sta_list_t *netif_sta_list);
62 
63 /**
64  * @}
65  */
66 
67 #ifdef __cplusplus
68 }
69 #endif
70 
71 #endif //_ESP_NETIF_STA_LIST_H_
72