1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-13 05:53:06 +01:00

add new function getBoatDataValues to api for easier access

This commit is contained in:
wellenvogel
2021-12-03 17:00:51 +01:00
parent b4b08fa12d
commit 04d90447e8
7 changed files with 106 additions and 7 deletions

View File

@@ -339,6 +339,15 @@ public:
virtual GwLog* getLogger(){
return &logger;
}
virtual GwApi::ValueMap getBoatDataValues(GwApi::StringList names){
std::map<String,double> rt;
for (auto it=names.begin();it!= names.end();it++){
if (boatData.isValid(*it)){
rt[*it]=boatData.getDoubleValue(*it,0);
}
}
return rt;
}
virtual GwBoatData *getBoatData(){
return &boatData;
}
@@ -357,8 +366,8 @@ bool delayedRestart(){
vTaskDelete(NULL);
},"reset",1000,&logger,0,NULL) == pdPASS;
}
GwUserCode userCodeHandler(new ApiImpl(MIN_USER_TASK),&mainLock);
ApiImpl *apiImpl=new ApiImpl(MIN_USER_TASK);
GwUserCode userCodeHandler(apiImpl,&mainLock);
#define JSON_OK "{\"status\":\"OK\"}"