O'Reilly logo

Mastering Internet of Things by Peter Waher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Handling incoming commands

As soon as the MQTT client receives data on any of the topics it has subscribed to, it raises the OnContentReceived event. We provide an event handler to parse incoming data.

Extra care must be taken, considering we don't know who sent the data, how the data has been encoded, or even if it is correctly encoded. Also remember that the maximum size of an MQTT packet is 256 MB, which may create temporary memory problems for small devices.  In the new MQTT v5 specification published by Oasis on December 25 2017, a client can specify a maximum packet size. This would mitigate this problem if supported. There is also a possibility to control the flow of packets, by stating the amount of concurrent packages requiring ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required