Skip to content

Commit

Permalink
Merge pull request #917 from omarcostahamido/patch-2
Browse files Browse the repository at this point in the history
fix typos in WebSocketClientSocketIOack.ino
  • Loading branch information
Links2004 authored Nov 17, 2024
2 parents 8cdcf47 + daf04b0 commit ca8026e
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit ca8026e

Please sign in to comment.