|
|
|
@ -128,9 +128,6 @@ void handle_Restore() { |
|
|
|
|
|
|
|
|
|
void handle_Cfg() { |
|
|
|
|
String jsonData = "{"; |
|
|
|
|
jsonData += jsonLineFromPreferenceString(PREF_APRS_MODE); |
|
|
|
|
jsonData += jsonLineFromPreferenceString(PREF_APRS_FREQ); |
|
|
|
|
jsonData += jsonLineFromPreferenceString(PREF_APRS_TXPOWER); |
|
|
|
|
jsonData += String("\"") + PREF_WIFI_PASSWORD + "\": \"" + jsonEscape((preferences.getString(PREF_WIFI_PASSWORD).isEmpty() ? String("") : "*")) + R"(",)"; |
|
|
|
|
jsonData += jsonLineFromPreferenceString(PREF_WIFI_SSID); |
|
|
|
|
jsonData += jsonLineFromPreferenceString(PREF_APRS_CALLSIGN); |
|
|
|
@ -149,6 +146,8 @@ void handle_Cfg() { |
|
|
|
|
jsonData += jsonLineFromPreferenceBool(PREF_APRS_FIXED_BEACON_PRESET); |
|
|
|
|
jsonData += jsonLineFromPreferenceBool(PREF_APRS_SHOW_ALTITUDE); |
|
|
|
|
jsonData += jsonLineFromPreferenceBool(PREF_APRS_GPS_EN); |
|
|
|
|
jsonData += jsonLineFromPreferenceString(PREF_APRS_FREQ); |
|
|
|
|
jsonData += jsonLineFromPreferenceString(PREF_APRS_MODE); |
|
|
|
|
jsonData += jsonLineFromPreferenceBool(PREF_DEV_OL_EN); |
|
|
|
|
jsonData += jsonLineFromPreferenceBool(PREF_APRS_SHOW_CMT); |
|
|
|
|
jsonData += jsonLineFromPreferenceBool(PREF_DEV_BT_EN); |
|
|
|
@ -181,18 +180,9 @@ void handle_ReceivedList() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void handle_SaveAPRSCfg() { |
|
|
|
|
if (server.hasArg(PREF_APRS_MODE) && !server.arg(PREF_APRS_MODE).isEmpty()){ |
|
|
|
|
preferences.putString(PREF_APRS_MODE, server.arg(PREF_APRS_MODE)); |
|
|
|
|
} |
|
|
|
|
if (server.hasArg(PREF_APRS_FREQ) && !server.arg(PREF_APRS_FREQ).isEmpty()){ |
|
|
|
|
preferences.putString(PREF_APRS_FREQ, server.arg(PREF_APRS_FREQ)); |
|
|
|
|
} |
|
|
|
|
if (server.hasArg(PREF_APRS_CALLSIGN) && !server.arg(PREF_APRS_CALLSIGN).isEmpty()){ |
|
|
|
|
preferences.putString(PREF_APRS_CALLSIGN, server.arg(PREF_APRS_CALLSIGN)); |
|
|
|
|
} |
|
|
|
|
if (server.hasArg(PREF_APRS_TXPOWER) && !server.arg(PREF_APRS_TXPOWER).isEmpty()){ |
|
|
|
|
preferences.putString(PREF_APRS_TXPOWER, server.arg(PREF_APRS_TXPOWER)); |
|
|
|
|
} |
|
|
|
|
if (server.hasArg(PREF_APRS_SYMBOL_TABLE) && !server.arg(PREF_APRS_SYMBOL_TABLE).isEmpty()){ |
|
|
|
|
preferences.putString(PREF_APRS_SYMBOL_TABLE, server.arg(PREF_APRS_SYMBOL_TABLE)); |
|
|
|
|
} |
|
|
|
@ -227,6 +217,7 @@ void handle_SaveAPRSCfg() { |
|
|
|
|
preferences.putString(PREF_APRS_LONGITUDE_PRESET, server.arg(PREF_APRS_LONGITUDE_PRESET)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
preferences.putBool(PREF_APRS_SHOW_BATTERY, server.hasArg(PREF_APRS_SHOW_BATTERY)); |
|
|
|
|
preferences.putBool(PREF_APRS_SHOW_ALTITUDE, server.hasArg(PREF_APRS_SHOW_ALTITUDE)); |
|
|
|
|
preferences.putBool(PREF_APRS_FIXED_BEACON_PRESET, server.hasArg(PREF_APRS_FIXED_BEACON_PRESET)); |
|
|
|
@ -246,6 +237,12 @@ void handle_saveDeviceCfg(){ |
|
|
|
|
preferences.putBool(PREF_DEV_AUTO_SHUT, server.hasArg(PREF_DEV_AUTO_SHUT)); |
|
|
|
|
if (server.hasArg(PREF_DEV_AUTO_SHUT_PRESET)){ |
|
|
|
|
preferences.putInt(PREF_DEV_AUTO_SHUT_PRESET, server.arg(PREF_DEV_AUTO_SHUT_PRESET).toInt()); |
|
|
|
|
} |
|
|
|
|
if (server.hasArg(PREF_APRS_FREQ)){ |
|
|
|
|
preferences.putString(PREF_APRS_FREQ, server.arg(PREF_APRS_FREQ)); |
|
|
|
|
}
|
|
|
|
|
if (server.hasArg(PREF_APRS_MODE)){ |
|
|
|
|
preferences.putString(PREF_APRS_MODE, server.arg(PREF_APRS_MODE)); |
|
|
|
|
}
|
|
|
|
|
server.sendHeader("Location", "/"); |
|
|
|
|
server.send(302,"text/html", ""); |
|
|
|
|