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

less memory for boatData request

This commit is contained in:
wellenvogel
2021-11-24 19:10:28 +01:00
parent fb13a70ce6
commit f5fcfa25c3
2 changed files with 4 additions and 2 deletions

View File

@@ -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);
}