What API might be used to get the state of a WiFi interface?

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

What API might be used to get the state of a WiFi interface?

Postby kolban » Tue Oct 11, 2016 10:55 pm

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

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: What API might be used to get the state of a WiFi interface?

Postby ESP_Angus » Tue Oct 11, 2016 11:22 pm

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.

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: What API might be used to get the state of a WiFi interface?

Postby Ritesh » Tue Dec 13, 2016 5:04 am

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.
Hi,

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

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: What API might be used to get the state of a WiFi interface?

Postby ESP_igrr » Tue Dec 13, 2016 1:28 pm

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.

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: What API might be used to get the state of a WiFi interface?

Postby Ritesh » Tue Dec 13, 2016 2:13 pm

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.
Thanks. That I have already implemented based on event handler but it will be good if we get that status in form of API.

Anyway, Let me update whenever you implement into SDK
Regards,
Ritesh Prajapati

Who is online

Users browsing this forum: MicroController and 132 guests