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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user