diff --git a/lib/boatData/GwBoatData.cpp b/lib/boatData/GwBoatData.cpp index 8ecba94..467d71b 100644 --- a/lib/boatData/GwBoatData.cpp +++ b/lib/boatData/GwBoatData.cpp @@ -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); } diff --git a/lib/boatData/GwBoatData.h b/lib/boatData/GwBoatData.h index 1bfdc50..866d086 100644 --- a/lib/boatData/GwBoatData.h +++ b/lib/boatData/GwBoatData.h @@ -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;}