mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2025-12-13 05:53:06 +01:00
less memory for boatData request
This commit is contained in:
@@ -55,7 +55,9 @@ String GwBoatData::toJson() const {
|
||||
count++;
|
||||
elementSizes+=it->second->getJsonSize();
|
||||
}
|
||||
DynamicJsonDocument json(JSON_OBJECT_SIZE(count)+elementSizes+10);
|
||||
int sz=JSON_OBJECT_SIZE(count)+elementSizes+10;
|
||||
LOG_DEBUG(GwLog::DEBUG,"size for boatData: %d",sz);
|
||||
DynamicJsonDocument json(sz);
|
||||
for (it=values.begin() ; it != values.end();it++){
|
||||
it->second->toJsonDoc(&json,minTime);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ class GwBoatItemBase{
|
||||
lastSet=0;
|
||||
}
|
||||
virtual void toJsonDoc(JsonDocument *doc, unsigned long minTime)=0;
|
||||
virtual size_t getJsonSize(){return JSON_OBJECT_SIZE(15);}
|
||||
virtual size_t getJsonSize(){return JSON_OBJECT_SIZE(10);}
|
||||
virtual int getLastSource()=0;
|
||||
virtual void refresh(unsigned long ts=0){uls(ts);}
|
||||
String getName(){return name;}
|
||||
|
||||
Reference in New Issue
Block a user