paclema / MQTTClient

MQTT Client library that wrappers ESP-IDF mqtt client component into a C++ class
Other
7 stars 0 forks source link

Replace topic on onSubscribed with onTopicStatus Observer callback #4

Closed paclema closed 1 year ago

paclema commented 1 year ago

Right now the callback method MQTTClientCallback::onSubscribed() is triggered when

However, we could provide topic subscription changes instead of notifying only on those mentioned cases, we could notify whenever we receive an update or status change for a specific topic, so we could inform every observer for each new topic status change.

paclema commented 1 year ago

It has been added MQTTClientCallback::onTopicUpdate callback method for that in this commit: https://github.com/paclema/MQTTClient/commit/39808134088b8448be8526f3e78f0a28c1a34b39 and also updated for esp8266 right after mqtt connect on: https://github.com/paclema/MQTTClient/commit/41e4d29563ac3c62e239558ae27d4f9d2e8bf7e1