CallbackMQTTDevice
The CallbackMQTTDevice class extends the MQTTDevice class by incorporating callback functionalities, enabling customized handling of incoming MQTT messages. This class allows to define specific behaviors in response to received messages, facilitating dynamic and responsive device interactions.
Methods:
CallbackMQTTDevice(Handler handler)Constructs aCallbackMQTTDeviceinstance with a specified handler function for processing incoming MQTT messages.void handle(const String &topic, const Bytes &payload) overrideOverrides the abstracthandlemethod fromMQTTDeviceto invoke the assigned callback function with the incoming message data.
Private Members:
Handler mHandlerStores the user-defined callback function responsible for processing incoming MQTT messages.
Last updated