mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-02-11 10:45:41 +00:00
Add option to disable 802.11b data rates
This commit is contained in:
@@ -877,7 +877,8 @@ void AmsWebServer::configurationJson() {
|
||||
strlen(wifiConfig.psk) > 0 ? "***" : "",
|
||||
wifiConfig.power / 10.0,
|
||||
wifiConfig.sleep,
|
||||
wifiConfig.autoreboot ? "true" : "false"
|
||||
wifiConfig.autoreboot ? "true" : "false",
|
||||
wifiConfig.use11b ? "true" : "false"
|
||||
);
|
||||
server.sendContent(buf);
|
||||
snprintf_P(buf, BufferSize, CONF_NET_JSON,
|
||||
@@ -1131,7 +1132,6 @@ void AmsWebServer::handleSave() {
|
||||
if(!psk.equals("***")) {
|
||||
strcpy(wifi.psk, psk.c_str());
|
||||
}
|
||||
wifi.mode = 1; // WIFI_STA
|
||||
|
||||
if(server.hasArg(F("sm")) && server.arg(F("sm")) == "static") {
|
||||
strcpy(wifi.ip, server.arg(F("si")).c_str());
|
||||
@@ -1157,7 +1157,6 @@ void AmsWebServer::handleSave() {
|
||||
meterConfig->baud = 2400;
|
||||
meterConfig->parity = 3; // 8N1
|
||||
case 2: // spenceme
|
||||
case 8: // dbeinder: HAN mosquito
|
||||
case 50: // Generic ESP32-S2
|
||||
case 51: // Wemos S2 mini
|
||||
case 70: // Generic ESP32-C3
|
||||
@@ -1168,6 +1167,10 @@ void AmsWebServer::handleSave() {
|
||||
case 7: // Pow-U+
|
||||
wifi.sleep = 2; // Light sleep
|
||||
break;
|
||||
case 8: // dbeinder: HAN mosquito
|
||||
wifi.sleep = 1; // Modem sleep
|
||||
wifi.use11b = 0;
|
||||
break;
|
||||
}
|
||||
config->setWiFiConfig(wifi);
|
||||
config->setMeterConfig(*meterConfig);
|
||||
@@ -1236,6 +1239,7 @@ void AmsWebServer::handleSave() {
|
||||
wifi.power = server.arg(F("ww")).toFloat() * 10;
|
||||
wifi.sleep = server.arg(F("wz")).toInt();
|
||||
wifi.autoreboot = server.hasArg(F("wa")) && server.arg(F("wa")) == F("true");
|
||||
wifi.use11b = server.hasArg(F("wb")) && server.arg(F("wb")) == F("true");
|
||||
config->setWiFiConfig(wifi);
|
||||
|
||||
if(server.hasArg(F("nm"))) {
|
||||
@@ -1915,6 +1919,7 @@ void AmsWebServer::configFileDownload() {
|
||||
if(strlen(wifi.dns2) > 0) server.sendContent(buf, snprintf_P(buf, BufferSize, PSTR("dns2 %s\n"), wifi.dns2));
|
||||
}
|
||||
server.sendContent(buf, snprintf_P(buf, BufferSize, PSTR("mdns %d\n"), wifi.mdns ? 1 : 0));
|
||||
server.sendContent(buf, snprintf_P(buf, BufferSize, PSTR("use11b %d\n"), wifi.use11b ? 1 : 0));
|
||||
}
|
||||
|
||||
if(includeMqtt) {
|
||||
|
||||
Reference in New Issue
Block a user