esp_netif_sta_list.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. // http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. // Unless required by applicable law or agreed to in writing, software
  9. // distributed under the License is distributed on an "AS IS" BASIS,
  10. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. // See the License for the specific language governing permissions and
  12. // limitations under the License.
  13. #ifndef _ESP_NETIF_STA_LIST_H_
  14. #define _ESP_NETIF_STA_LIST_H_
  15. #include "esp_netif_types.h"
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. /**
  20. * @brief station list info element
  21. */
  22. typedef struct {
  23. uint8_t mac[6]; /**< Station MAC address */
  24. esp_ip4_addr_t ip; /**< Station assigned IP address */
  25. } esp_netif_sta_info_t;
  26. /**
  27. * @brief station list structure
  28. */
  29. typedef struct {
  30. esp_netif_sta_info_t sta[ESP_WIFI_MAX_CONN_NUM]; /**< Connected stations */
  31. int num; /**< Number of connected stations */
  32. } esp_netif_sta_list_t;
  33. /**
  34. * @defgroup ESP_NETIF_STA_LIST ESP-NETIF STA list api
  35. * @brief List of stations for Wi-Fi AP interface
  36. *
  37. */
  38. /** @addtogroup ESP_NETIF_STA_LIST
  39. * @{
  40. */
  41. /**
  42. * @brief Get IP information for stations connected to the Wi-Fi AP interface
  43. *
  44. * @param[in] wifi_sta_list Wi-Fi station info list, returned from esp_wifi_ap_get_sta_list()
  45. * @param[out] netif_sta_list IP layer station info list, corresponding to MAC addresses provided in wifi_sta_list
  46. *
  47. * @return
  48. * - ESP_OK
  49. * - ESP_ERR_ESP_NETIF_NO_MEM
  50. * - ESP_ERR_ESP_NETIF_INVALID_PARAMS
  51. */
  52. esp_err_t esp_netif_get_sta_list(const wifi_sta_list_t *wifi_sta_list, esp_netif_sta_list_t *netif_sta_list);
  53. /**
  54. * @}
  55. */
  56. #ifdef __cplusplus
  57. }
  58. #endif
  59. #endif //_ESP_NETIF_STA_LIST_H_