How To Send Objects Instead Of String In Mqtt Messages?
I'm currently using mqtt to communicate between client and server and mqtt publish method takes message as bytes. I need to send latitude, longitude, address,etc in my single mqtt
Solution 1:
Serialise your objects to xml (or CSV or Json or roll-your-own format) strings. Form your message from those strings. Send your message as bytes. Reverse the process at the receiving end.
Post a Comment for "How To Send Objects Instead Of String In Mqtt Messages?"