Skip to content

Commit

Permalink
Stringify array items "natively" assuming they fit in RAM.
Browse files Browse the repository at this point in the history
  • Loading branch information
Idorobots committed Dec 24, 2023
1 parent cb662d7 commit 32a9e0e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion device/src/APIServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ void streamJSON(WiFiClient& client, JSONVar& json) {
int len = json.length();
for (uint16_t i = 0; i < len; i++) {
JSONVar value = json[i];
streamJSON(client, value);
// NOTE Assumes that these will be small enough to fit in RAM one at one time.
client.write(JSON.stringify(value).c_str());

if (i < len - 1) {
client.write(",");
Expand Down

0 comments on commit 32a9e0e

Please sign in to comment.