Skip to content

Commit

Permalink
Update additional instance of deprecated JSON API usage
Browse files Browse the repository at this point in the history
  • Loading branch information
rbroker committed Mar 9, 2024
1 parent c1c0aed commit 71ebf65
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ecodan-ha-local/ehal_diagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ namespace ehal

String logs_as_json()
{
DynamicJsonDocument json((MAX_MESSAGE_LENGTH * MAX_NUM_ELEMENTS) + 1024);
JsonArray msg = json.createNestedArray(F("messages"));
JsonDocument doc;
JsonArray msg = doc["messages"].to<JsonArray>();

{
std::lock_guard<std::mutex> lock(diagnosticRingbufferLock);
Expand All @@ -120,7 +120,7 @@ namespace ehal
}

String jsonOut;
serializeJson(json, jsonOut);
serializeJson(doc, jsonOut);

return jsonOut;
}
Expand Down

0 comments on commit 71ebf65

Please sign in to comment.