![]() |
|
Uniot Core
|
| 0.8.1 |
#include <TopDevice.h>
Public Member Functions | |
| TopDevice () | |
| Construct a new TopDevice instance. | |
| virtual void | syncSubscriptions () override |
| Set up MQTT topic subscriptions for device monitoring. | |
| void | setScheduler (const TaskScheduler &scheduler) |
| Associate a TaskScheduler with this monitoring device. | |
| virtual void | handle (const String &topic, const Bytes &payload) override |
| Handle incoming MQTT messages. | |
| void | handleTop () |
| Handle request for task and system performance data. | |
| void | handleMem () |
| Handle request for memory usage information. | |
Public Member Functions inherited from uniot::MQTTDevice | |
| MQTTDevice () | |
| Constructs a new MQTTDevice instance. | |
| virtual | ~MQTTDevice () |
| Virtual destructor that handles cleanup and unregistration from MQTTKit. | |
| const String & | getDeviceId () const |
| Gets the device identifier. | |
| const String & | getOwnerId () const |
| Gets the owner identifier. | |
| const String & | subscribe (const String &topic) |
| Subscribes to a specific MQTT topic. | |
| const String & | subscribeDevice (const String &subTopic) |
| Subscribes to a device-specific subtopic. | |
| const String & | subscribeGroup (const String &groupId, const String &subTopic) |
| Subscribes to a group-specific subtopic. | |
| bool | unsubscribe (const String &topic) |
| Unsubscribes from a specific topic. | |
| void | unsubscribeFromAll () |
| Unsubscribes from all subscribed topics. | |
| bool | isSubscribed (const String &topic) |
| Checks if the device is subscribed to a given topic. | |
| bool | isTopicMatch (const String &storedTopic, const String &incomingTopic) const |
| Determines if a stored topic matches an incoming topic string using MQTT wildcards. | |
| void | publish (const String &topic, const Bytes &payload, bool retained=false, bool sign=false) |
| Publishes a message to a specific topic. | |
| void | publishDevice (const String &subTopic, const Bytes &payload, bool retained=false, bool sign=false) |
| Publishes a message to a device-specific subtopic. | |
| void | publishGroup (const String &groupId, const String &subTopic, const Bytes &payload, bool retained=false, bool sign=false) |
| Publishes a message to a group-specific subtopic. | |
| void | publishEmptyDevice (const String &subTopic) |
| Publishes an empty message to a device-specific subtopic with retained flag set. | |
|
inline |
|
inlineoverridevirtual |
Handle incoming MQTT messages.
Routes incoming messages to the appropriate handler based on the topic.
| topic | The MQTT topic of the received message |
| payload | The binary payload of the message @override Implements MQTTDevice::handle |
Implements uniot::MQTTDevice.
|
inline |
Handle request for memory usage information.
Collects and publishes information about available free heap memory. Data is sent via MQTT in CBOR format to the "debug/mem" topic.
|
inline |
Handle request for task and system performance data.
Collects and publishes information about:
Data is sent via MQTT in CBOR format to the "debug/top" topic.
|
inline |
Associate a TaskScheduler with this monitoring device.
Links a TaskScheduler to enable task performance monitoring. The scheduler is required for the 'top' functionality to work.
| scheduler | Reference to the TaskScheduler to monitor |
|
inlineoverridevirtual |
Set up MQTT topic subscriptions for device monitoring.
Subscribes to debug topics that trigger system information requests:
@override Implements MQTTDevice::syncSubscriptions
Implements uniot::MQTTDevice.