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

allow to set default and hide for cfg values in hardware defs

This commit is contained in:
andreas
2023-10-05 16:57:05 +02:00
parent 27de94b1ae
commit 9572b1e95e
6 changed files with 58 additions and 4 deletions

View File

@@ -430,11 +430,16 @@ class CapabilitiesRequest : public GwRequestMessage{
protected:
virtual void processRequest(){
int numCapabilities=userCodeHandler.getCapabilities()->size();
GwJsonDocument json(JSON_OBJECT_SIZE(numCapabilities*3+8));
int numHidden=config.numHidden();
GwJsonDocument json(JSON_OBJECT_SIZE(numCapabilities*3+numHidden*2+8));
for (auto it=userCodeHandler.getCapabilities()->begin();
it != userCodeHandler.getCapabilities()->end();it++){
json[it->first]=it->second;
}
std::vector<String> hiddenCfg=config.getHidden();
for (auto it=hiddenCfg.begin();it != hiddenCfg.end();it++){
json["HIDE"+*it]=true;
}
json["serialmode"]=channels.getMode(SERIAL1_CHANNEL_ID);
json["serial2mode"]=channels.getMode(SERIAL2_CHANNEL_ID);
#ifdef GWBUTTON_PIN