washo4evr / Socket.io-v1.x-Library

Socket.io Library for Arduino
108 stars 58 forks source link

Rcontent issue #42

Open HudsonProdigy opened 7 years ago

HudsonProdigy commented 7 years ago

Hello, I am having issue with library, i have spent much time trying to figure out what is going on but have had no luck. it seems that parser method may be broken as Rcontent is not being created correctly.

Example.

Server:

function UpdateEsp(){ console.log("Updating Esp!"); console.log(currentEffect); console.log(JSON.stringify(currentEffect)) socket.emit('FXData', { "FXData" :100 }); };

ESP: if (client.monitor()) { if (RID == "FXData") { Serial.println(RID); Serial.println(Rname); Serial.println(Rcontent); }
}

Debugger is displaying:

Received message = 42["FXData",{"FXData":100}] FXData FXData 00}]

///End

Any ideas what may be causing the issue? I have simplified code to make issue more evident , any help would be greatly appropriated.

Cheers

HudsonProdigy commented 7 years ago

I solved issue by editing library code. Line 123 to : Rcontent = rcvdmsg.substring(rcvdmsg.indexOf("\":") + 2, rcvdmsg.lastIndexOf('}'));