What API might be used to get the state of a WiFi interface?
What API might be used to get the state of a WiFi interface?
I am thinking that there are two WiFi interfaces on the ESP32 ... one for station and one for access point. I am also assuming that they have "state" associated with them such as whether connected, disconnected, off and others. Is there an exposed/recommended API to determine the state of both interfaces?
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: What API might be used to get the state of a WiFi interface?
Currently the only supported way to do this is to receive events and update/maintain a copy of the state yourself. The station & AP interfaces have different event flags - SYSTEM_EVENT_STA_xxx & SYSTEM_EVENT_AP_xxx respectively.
We know this is not optimal and API calls to retrieve the current interface state are in the works.
We know this is not optimal and API calls to retrieve the current interface state are in the works.
Re: What API might be used to get the state of a WiFi interface?
Hi,ESP_Angus wrote:Currently the only supported way to do this is to receive events and update/maintain a copy of the state yourself. The station & AP interfaces have different event flags - SYSTEM_EVENT_STA_xxx & SYSTEM_EVENT_AP_xxx respectively.
We know this is not optimal and API calls to retrieve the current interface state are in the works.
I also need requirement of APIs to get connection status for AP and STATION mode wifi interface and based on that I need to implement LED connectivity status as per AP and STATION connected with wifi.
So, Right now there is only way to detect status of WiFi and STATION connectivity from event handler. When you are planning to implement API to get direct connection status for STA+AP mode connectivity?
Please let me know if you have any informations regarding this.
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: What API might be used to get the state of a WiFi interface?
Yes, we have this planned, but not for the next release. For now you can use event handler function to save latest state into a variable, and then use this variable whenever you need to get the state.
Re: What API might be used to get the state of a WiFi interface?
Thanks. That I have already implemented based on event handler but it will be good if we get that status in form of API.ESP_igrr wrote:Yes, we have this planned, but not for the next release. For now you can use event handler function to save latest state into a variable, and then use this variable whenever you need to get the state.
Anyway, Let me update whenever you implement into SDK
Regards,
Ritesh Prajapati
Ritesh Prajapati
Who is online
Users browsing this forum: Baidu [Spider] and 263 guests