Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By burkmurray
#21146 This seems like one of those things that ought to be obvious, but i'm just not getting it: how can I read the current WiFiMode?

WiFi.mode() returns 0, which makes sense as it's a void function. wifi_get_opmode seems like it ought to work, but I can't figure out the syntax to get it to compile:

Code: Select all  Serial.print("Wifi Mode:");
  Serial.println(wifi_get_opmode());


Yes, i've included ESP8266WiFi.h. Is there a special sauce syntax I need to use, or am I barking up the wrong tree? Anybody?
User avatar
By tytower
#21170 wifi_get_opmode()
It seems to me that that is an internal variable so not available to you unless you change its declaration in the .cpp file ?
Is this of any use?
enum WiFiMode { WIFI_OFF = 0, WIFI_STA = 1, WIFI_AP = 2, WIFI_AP_STA = 3 };
Interested but I don't know much about it sorry.