Skip to content

Commit bfa1bb0

Browse files
committed
wifi toggle helper
1 parent 52de488 commit bfa1bb0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

wifi_funcs.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55

66
// const char* hostname = "esp8266REFLOW";
77

8+
9+
// enable wifi sta
10+
// disable sleep
11+
// timeout connect
12+
// set hostname ?
813
void init_WiFi(int timeout = 10000){
914
WiFi.mode(WIFI_STA);
1015
#ifdef ESP8266
@@ -67,6 +72,15 @@ void checkWifi(){
6772
}
6873
}
6974

75+
void enableWiFi(){
76+
WiFi.mode(WIFI_STA);
77+
init_WiFi();
78+
}
79+
80+
void disableWiFi(){
81+
WiFi.mode(WIFI_OFF);
82+
}
83+
7084
// uint32_t ResetReason(void)
7185
// {
7286

0 commit comments

Comments
 (0)