1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-14 06:23:07 +01:00

allow to hide config values by calling setValue

This commit is contained in:
andreas
2023-10-27 21:32:16 +02:00
parent 95d9025f8e
commit 51065acc8d
3 changed files with 12 additions and 12 deletions

View File

@@ -120,11 +120,12 @@ int GwConfigHandler::getInt(const String name,int defaultv) const{
void GwConfigHandler::stopChanges(){
allowChanges=false;
}
bool GwConfigHandler::setValue(String name,String value){
bool GwConfigHandler::setValue(String name,String value, bool hide){
if (! allowChanges) return false;
GwConfigInterface *i=getConfigItem(name,false);
if (!i) return false;
i->value=value;
i->type=hide?GwConfigInterface::HIDDEN:GwConfigInterface::READONLY;
return true;
}

View File

@@ -36,7 +36,7 @@ class GwConfigHandler: public GwConfigDefinitions{
* will become a noop after stopChanges has been called
* !use with care! no checks of the value
*/
bool setValue(String name, String value);
bool setValue(String name, String value, bool hide=false);
static void toHex(unsigned long v,char *buffer,size_t bsize);
unsigned long getSaltBase(){return saltBase;}
~GwConfigHandler();