Skip to content

Commit 82bb82a

Browse files
committed
Merge pull request #794 from paulmand3l/esp8266
Adding getMode() function to WiFi library so I can easily get the current mode of the wifi.
2 parents 378ce87 + 4719a31 commit 82bb82a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

libraries/ESP8266WiFi/src/ESP8266WiFi.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ void ESP8266WiFiClass::mode(WiFiMode m)
7474
ETS_UART_INTR_ENABLE();
7575
}
7676

77+
WiFiMode ESP8266WiFiClass::getMode()
78+
{
79+
return (WiFiMode)wifi_get_opmode();
80+
}
81+
7782
void ESP8266WiFiClass::_mode(WiFiMode m)
7883
{
7984
if(wifi_get_opmode() == (uint8)m) {

libraries/ESP8266WiFi/src/ESP8266WiFi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class ESP8266WiFiClass
4444
ESP8266WiFiClass();
4545

4646
void mode(WiFiMode);
47+
WiFiMode getMode();
4748

4849
/**
4950
* Start Wifi connection

0 commit comments

Comments
 (0)