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:
13
src/main.cpp
13
src/main.cpp
@@ -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\"}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user