12#include "../evt/ksEvent.h"
13#include "../ksComponent.h"
14#include "../misc/ksSimpleTimer.h"
18 class ksMqttConnector;
A component that periodically reports the device state to the broker.
Definition ksDevStatMqttReporter.h:30
misc::ksSimpleTimer reporterTimer
Timer to report device stats.
Definition ksDevStatMqttReporter.h:36
void reportDevStats() const
Reports device statistics to the MQTT broker.
Definition ksDevStatMqttReporter.cpp:45
void onConnected()
Calback executed on MQTT connection.
Definition ksDevStatMqttReporter.cpp:40
bool loop(ksApplication *app) override
Handles MQTT debug connector component loop logic.
Definition ksDevStatMqttReporter.cpp:59
bool postInit(ksApplication *app) override
Handles component post-initialization.
Definition ksDevStatMqttReporter.cpp:30
std::unique_ptr< evt::ksEventHandle > connEventHandle
Event handle for connection delegate.
Definition ksDevStatMqttReporter.h:35
std::weak_ptr< ksMqttConnector > mqttConnWp
Weak pointer to MQTT connector.
Definition ksDevStatMqttReporter.h:34
ksDevStatMqttReporter(uint8_t intervalInSeconds=60)
Constructs device statistics reporter component.
Definition ksDevStatMqttReporter.cpp:26
std::shared_ptr< ksf::evt::ksEvent< std::shared_ptr< ksMqttConnector > & > > onReportCustomStats
Called when Dev Stat Reporter timer is triggered. Users can bind to this event to add their own stats...
Definition ksDevStatMqttReporter.h:57
A class that serves as the base for user-defined applications.
Definition ksApplication.h:44
Base component class.
Definition ksComponent.h:36
A simple timer class that does not rely on component architecture.
Definition ksSimpleTimer.h:27