Hello,
I've found there's SYSTEM_EVENT_AP_STAIPASSIGNED callback which is called when a client connects to ESP32 softAP and gets IP from ESP32 DHCP server. But is there any way to know which IP was assigned? There is no corresponding member in system_event_info_t union in esp_event.h.
Any information for SYSTEM_EVENT_AP_STAIPASSIGNED callback?
Re: Any information for SYSTEM_EVENT_AP_STAIPASSIGNED callback?
You can use
to get the stations list.
Than you can iteraatee trough stations list to get the stations IPs:
Code: Select all
wifi_sta_list_t station_list;
esp_wifi_ap_get_sta_list(&station_list)
wifi_sta_info_t *stations = (wifi_sta_info_t*)station_list.sta;
Than you can iteraatee trough stations list to get the stations IPs:
Code: Select all
for (int i = 0; i < station_list.num; ++i) {
ip4_addr_t addr;
dhcp_search_ip_on_mac(stations[i].mac , &addr)
}
Who is online
Users browsing this forum: No registered users and 116 guests