1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2026-01-09 01:53:07 +01:00
Files
esp32-nmea2000-obp60/lib/boatData/GwBoatData.cpp
2021-10-30 12:01:50 +02:00

26 lines
638 B
C++

#include "GwBoatData.h"
GwBoatData::GwBoatData(GwLog *logger){
this->logger=logger;
}
GwBoatData::~GwBoatData(){
GwBoatItemBase::GwBoatItemMap::iterator it;
for (it=values.begin() ; it != values.end();it++){
delete it->second;
}
}
String GwBoatData::toJson() const {
long minTime=millis();
DynamicJsonDocument json(800);
GwBoatItemBase::GwBoatItemMap::const_iterator it;
for (it=values.begin() ; it != values.end();it++){
if (it->second->isValid(minTime)){
it->second->toJsonDoc(&json,it->first);
}
}
String buf;
serializeJson(json,buf);
return buf;
}