ESPMegaPRO-v3-SDK/Template Project/lib/ESPMegaPRO/IoTComponent.hpp

17 lines
549 B
C++

#pragma once
#include <ExpansionCard.hpp>
#include <PubSubClient.h>
class IoTComponent {
public:
virtual bool begin(uint8_t card_id, ExpansionCard *card, PubSubClient *mqtt, char *base_topic);
virtual void handleMqttMessage(char *topic, char *payload);
void setMqttClient(PubSubClient *mqtt);
virtual void publishReport();
virtual uint8_t getType();
protected:
char *base_topic;
void publishRelative(char *topic, char *payload);
PubSubClient *mqtt;
uint8_t card_id;
};