Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void socketIOEvent(socketIOmessageType_t type, uint8_t * payload, size_t length)

// Message Includes a ID for a ACK (callback)
if(id) {
// creat JSON message for Socket.IO (ack)
// create JSON message for Socket.IO (ack)
DynamicJsonDocument docOut(1024);
JsonArray array = docOut.to<JsonArray>();

Expand Down Expand Up @@ -130,19 +130,19 @@ void loop() {
if(now - messageTimestamp > 2000) {
messageTimestamp = now;

// creat JSON message for Socket.IO (event)
// create JSON message for Socket.IO (event)
DynamicJsonDocument doc(1024);
JsonArray array = doc.to<JsonArray>();

// add evnet name
// add event name
// Hint: socket.on('event_name', ....
array.add("event_name");

// add payload (parameters) for the event
JsonObject param1 = array.createNestedObject();
param1["now"] = (uint32_t) now;

// JSON to String (serializion)
// JSON to String (serialization)
String output;
serializeJson(doc, output);

Expand Down