Skip to content

Commit 2b513b1

Browse files
committed
remove redundant d:{}
Signed-off-by: John Walicki <[email protected]>
1 parent 2621d47 commit 2b513b1

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

WatsonIoT/src/main.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -550,13 +550,12 @@ void Send10Seconds2Cloud() {
550550
// Allocate a ArduinoJson buffer large enough to 10 seconds of Accelerometer trace data
551551
DynamicJsonDocument historydoc(16384);
552552
JsonObject payload = historydoc.to<JsonObject>();
553-
JsonObject status = payload.createNestedObject("d");
554-
JsonArray alltraces = status.createNestedArray("traces");
553+
JsonArray alltraces = payload.createNestedArray("traces");
555554
JsonObject acceleration = alltraces.createNestedObject();
556555

557556
// Load the key/value pairs into the serialized ArduinoJSON format
558-
status["device_id"] = deviceID ;
559-
status["device_t"] = time(nullptr);
557+
payload["device_id"] = deviceID ;
558+
payload["device_t"] = time(nullptr);
560559

561560
// Generate an array of json objects that contain x,y,z arrays of 32 floats.
562561
// [{"x":[],"y":[],"z":[]},{"x":[],"y":[],"z":[]}]
@@ -600,13 +599,12 @@ void SendLiveData2Cloud() {
600599
// DynamicJsonDocument is stored on the heap
601600
DynamicJsonDocument jsonDoc(3000);
602601
JsonObject payload = jsonDoc.to<JsonObject>();
603-
JsonObject status = payload.createNestedObject("d");
604-
JsonArray traces = status.createNestedArray("traces");
602+
JsonArray traces = payload.createNestedArray("traces");
605603
JsonObject acceleration = traces.createNestedObject();
606604

607605
// Load the key/value pairs into the serialized ArduinoJSON format
608-
status["device_id"] = deviceID;
609-
status["device_t"] = time(nullptr);
606+
payload["device_id"] = deviceID;
607+
payload["device_t"] = time(nullptr);
610608

611609
// Generate an array of json objects that contain x,y,z arrays of 32 floats.
612610
// [{"x":[],"y":[],"z":[]},{"x":[],"y":[],"z":[]}]

0 commit comments

Comments
 (0)