mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2025-12-15 23:13:07 +01:00
optimize memory usage for config data, allow 4s timeout for setConfig
This commit is contained in:
@@ -7,11 +7,28 @@ class GwConfigHandler;
|
||||
class GwConfigInterface{
|
||||
private:
|
||||
String name;
|
||||
String initialValue;
|
||||
const char * initialValue;
|
||||
String value;
|
||||
bool secret=false;
|
||||
String changedValue;
|
||||
bool hasChangedValue=false;
|
||||
void updateValue(String value,bool cmpDefault=false){
|
||||
hasChangedValue=false;
|
||||
if (cmpDefault){
|
||||
if (value != initialValue) {
|
||||
changedValue=value;
|
||||
hasChangedValue=true;
|
||||
}
|
||||
}
|
||||
else{
|
||||
if (value != this->value) {
|
||||
changedValue=value;
|
||||
hasChangedValue=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
public:
|
||||
GwConfigInterface(const String &name, const String initialValue, bool secret=false){
|
||||
GwConfigInterface(const String &name, const char * initialValue, bool secret=false){
|
||||
this->name=name;
|
||||
this->initialValue=initialValue;
|
||||
this->value=initialValue;
|
||||
|
||||
Reference in New Issue
Block a user