April 2017
Intermediate to advanced
280 pages
6h 18m
English
The onMessageArrived function receives a Paho.MQTT.Message instance in the message argument. The code prints a message to the console log indicating that a message has arrived with the destination topic and the payload string included in the message.destinationName and message.payloadString attributes.
Then, the code checks whether message.destionationName starts with APP.HomeAutomation.Manager.ledResultBaseTopic to make sure that the message's destination topic is the one defined for the results of the commands related to LEDs.
In this case, the code only subscribes to the topic filters that we defined for publishing messages with the results of the commands related to LEDs. However, we include ...
Read now
Unlock full access