#pragma once #include class DigitalInputRTU : public ESPMegaRTU { public: DigitalInputRTU(); ~DigitalInputRTU(); void begin(char* remoteBaseTopic, uint8_t remote_card_slot, ESPMegaIoT* iot); void subscribe(); bool digitalRead(uint8_t pin); uint8_t registerCallback(std::function callback); void unregisterCallback(uint8_t handler); private: void mqttCallback(char* topic, char* payload); ESPMegaIoT* iot; size_t size; uint16_t callbackCount; std::map> callbacks; bool inputBuffer[16]; };