#pragma once #include #include 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(); virtual void subscribe(); void loop(); protected: char *base_topic; void publishRelative(const char *topic, const char *payload); void subscribeRelative(const char *topic); PubSubClient *mqtt; uint8_t card_id; };