April 2017
Intermediate to advanced
280 pages
6h 18m
English
When we declare a function, we pass this function as an argument to another function or method, or we assign this function to an attribute, and then some code calls this function at some time; this mechanism is known as callback. The name callback is used because the code calls back a function at some time.
The code declares three functions that we will specify as callbacks:
on_connect: This function will be called when the MQTT client receives a CONNACK response from the MQTT server, that is, when a connection has been successfully established with the MQTT server.on_subscribe: This function will be called when the MQTT client receives a SUBACK response from the MQTT server, that is, when a subscription has been successfully ...Read now
Unlock full access