2023-12-28 05:46:39 +00:00
|
|
|
#pragma once
|
|
|
|
#include <ExpansionCard.hpp>
|
|
|
|
#include <PubSubClient.h>
|
|
|
|
class IoTComponent {
|
|
|
|
public:
|
2023-12-28 07:08:10 +00:00
|
|
|
virtual bool begin(uint8_t card_id, ExpansionCard *card, PubSubClient *mqtt, char *base_topic);
|
2023-12-28 05:46:39 +00:00
|
|
|
virtual void handleMqttMessage(char *topic, char *payload);
|
|
|
|
void setMqttClient(PubSubClient *mqtt);
|
2023-12-28 06:14:18 +00:00
|
|
|
virtual void publishReport();
|
|
|
|
virtual uint8_t getType();
|
|
|
|
protected:
|
2023-12-28 06:34:51 +00:00
|
|
|
char *base_topic;
|
2023-12-28 07:08:10 +00:00
|
|
|
void publishRelative(char *topic, char *payload);
|
2023-12-28 05:46:39 +00:00
|
|
|
PubSubClient *mqtt;
|
2023-12-28 07:08:10 +00:00
|
|
|
uint8_t card_id;
|
2023-12-28 05:46:39 +00:00
|
|
|
};
|