From 216b7e3f5c09d596206cbc61f90bb5175e676c65 Mon Sep 17 00:00:00 2001
From: Eric Duminil <eric.duminil@gmail.com>
Date: Wed, 16 Feb 2022 12:18:07 +0100
Subject: [PATCH] Updated config

---
 ampel-firmware/web_config.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/ampel-firmware/web_config.cpp b/ampel-firmware/web_config.cpp
index d4096b9..a3451ac 100644
--- a/ampel-firmware/web_config.cpp
+++ b/ampel-firmware/web_config.cpp
@@ -1,6 +1,6 @@
 #include "web_config.h"
 
-#define STRING_LEN 40 // Should be enough for ip, addresses, passwords...
+#define STRING_LEN 33 // Should be enough for ip, addresses, passwords...
 
 #include "config.h"
 #ifndef AMPEL_PASSWORD
@@ -28,7 +28,7 @@ namespace web_config {
 
   IotWebConf *iotWebConf;
 
-  const char config_version[IOTWEBCONF_CONFIG_VERSION_LENGTH] = "a09"; // -- Configuration specific key. The value should be modified if config structure was changed.
+  const char config_version[IOTWEBCONF_CONFIG_VERSION_LENGTH] = "a10"; // -- Configuration specific key. The value should be modified if config structure was changed.
   using namespace iotwebconf;
 
   /**
@@ -141,7 +141,7 @@ namespace web_config {
   LORAWAN_DEVICE_EUI).build();
   TextTParameter<17> appEUIParam = Builder<TextTParameter<17>>("app_eui").label("App EUI (MSB)").defaultValue(
   LORAWAN_APPLICATION_EUI).build();
-  TextTParameter<33> appKeyParam = Builder<TextTParameter<33>>("app_key").label("App key (MSB)").defaultValue(
+  PasswordTParameter<33> appKeyParam = Builder<PasswordTParameter<33>>("app_key").label("App key (MSB)").defaultValue(
   LORAWAN_APPLICATION_KEY).build();
 #endif
 
@@ -223,6 +223,7 @@ namespace web_config {
     //TODO: Add "ap" command?
     //TODO: Add "wifi_ssid" command?
     //TODO: Add "wifi_password" command?
+    //TODO: Add "save_config" command?
     sensor_console::defineCommand("reset_config", []() {
       Serial.println(F("Resetting config..."));
       iotWebConf->getRootParameterGroup()->applyDefaultValue();
-- 
GitLab