Add new options to WIFI command

Actual Options:
0 - Turn Off Wi-Fi
1 - Turn On Wi-Fi
New Options Added:
2 - Force the device to ONLY connects as a 11b device
3 - Force the device to ONLY connects as a 11b/g device
4 - Force the device to connects as a 11b/g/n device
This commit is contained in:
Adrian Scillato 2021-06-04 09:57:25 -03:00 committed by GitHub
parent ae133f1933
commit 5206054886
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -2142,8 +2142,12 @@ void CmndWifi(void)
if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 1)) {
Settings.flag4.network_wifi = XdrvMailbox.payload;
if (Settings.flag4.network_wifi) { WifiEnable(); }
#ifdef ESP8266
} else if ((XdrvMailbox.payload >= 2) && (XdrvMailbox.payload <= 4)) {
WiFi.setPhyMode(WiFiPhyMode_t(XdrvMailbox.payload - 1)); // 1-B/2-BG/3-BGN
#endif
}
ResponseCmndStateText(Settings.flag4.network_wifi);
Response_P(PSTR("{\"" D_JSON_WIFI "\":\"%s\",\"" D_JSON_WIFI_MODE "\":\"11%c\"}"), GetStateText(Settings.flag4.network_wifi), pgm_read_byte(&kWifiPhyMode[WiFi.getPhyMode() & 0x3]) );
}
#ifdef USE_I2C