-->
Page 1 of 1

Read WiFiMode?

PostPosted: Sun Jun 21, 2015 5:01 pm
by burkmurray
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?

Re: Read WiFiMode?

PostPosted: Sun Jun 21, 2015 10:43 pm
by tytower
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.