Browse Source

Merge from master to dev

pull/1/head
US1GHQ 3 months ago
parent
commit
e538f678a5
  1. 8
      data_embed/index.html
  2. 6
      include/preference_storage.h
  3. 5
      src/taskWebServer.cpp

8
data_embed/index.html

@ -142,6 +142,14 @@
<h2 class="u-full-width">Device Settings</h2>
</div>
<div class="grid-container quarters">
<div>
<label for="aprs_freq">APRS Freq</label>
<input name="aprs_freq" id="aprs_freq" type="number" min="410000" max="510000" title="Working freq, default 433.775">
</div>
<div>
<label for="aprs_mode">APRS Mode</label>
<input name="aprs_mode" id="aprs_mode" type="number" min="410000" max="510000" title="APRS Mode 300/1200b">
</div>
<div>
<label for="oled_enabled">Display dimmer enabled</label>
<input name="oled_enabled" id="oled_enabled" type="checkbox" value="1" title="enable or disable oled dimmer">

6
include/preference_storage.h

@ -8,6 +8,11 @@
extern Preferences preferences;
// MAX 15 chars for preferenece key!!!
// FREQ AND MODE SET
static const char *const PREF_APRS_MODE = "aprs_mode"; //300 or 1200b
static const char *const PREF_APRS_FREQ = "aprs_freq"; //freq default: 433.775
//MAIN SETTINGS
static const char *const PREF_WIFI_SSID = "wifi_ssid";
static const char *const PREF_WIFI_PASSWORD = "wifi_password";
static const char *const PREF_APRS_CALLSIGN = "aprs_callsign";
@ -29,6 +34,7 @@ static const char *const PREF_APRS_FIXED_BEACON_PRESET = "aprs_fixed_beac";
static const char *const PREF_APRS_FIXED_BEACON_PRESET_INIT = "aprs_fix_b_init";
static const char *const PREF_APRS_FIXED_BEACON_INTERVAL_PRESET = "aprs_fb_interv";
static const char *const PREF_APRS_FIXED_BEACON_INTERVAL_PRESET_INIT = "aprs_fb_in_init";
// SMART BEACONING
static const char *const PREF_APRS_SB_MIN_INTERVAL_PRESET = "sb_min_interv";
static const char *const PREF_APRS_SB_MIN_INTERVAL_PRESET_INIT = "sb_min_interv_i";

5
src/taskWebServer.cpp

@ -128,6 +128,8 @@ void handle_Restore() {
void handle_Cfg() {
String jsonData = "{";
jsonData += jsonLineFromPreferenceString(PREF_APRS_MODE);
jsonData += jsonLineFromPreferenceString(PREF_APRS_FREQ);
jsonData += String("\"") + PREF_WIFI_PASSWORD + "\": \"" + jsonEscape((preferences.getString(PREF_WIFI_PASSWORD).isEmpty() ? String("") : "*")) + R"(",)";
jsonData += jsonLineFromPreferenceString(PREF_WIFI_SSID);
jsonData += jsonLineFromPreferenceString(PREF_APRS_CALLSIGN);
@ -178,6 +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_CALLSIGN) && !server.arg(PREF_APRS_CALLSIGN).isEmpty()){
preferences.putString(PREF_APRS_CALLSIGN, server.arg(PREF_APRS_CALLSIGN));
}

Loading…
Cancel
Save