19 lines
683 B
C++
19 lines
683 B
C++
#pragma once
|
|
|
|
#include <IoTComponent.hpp>
|
|
#include <DigitalInputCard.hpp>
|
|
|
|
class DigitalInputIoT : public IoTComponent {
|
|
public:
|
|
bool begin(uint8_t card_id, DigitalInputCard *card, PubSubClient *mqtt, char *base_topic);
|
|
void handleMqttMessage(char *topic, char *payload);
|
|
void publishDigitalInputs();
|
|
void setDigitalInputsPublishEnabled(bool enabled);
|
|
void handleValueChange(uint8_t pin, uint8_t value);
|
|
void registerValueChangeCallback(void (*callback)(uint8_t, uint8_t));
|
|
void publishReport();
|
|
uint8_t getType();
|
|
private:
|
|
bool digital_inputs_publish_enabled = false;
|
|
DigitalInputCard *card;
|
|
}; |