rename folders
This commit is contained in:
parent
1ec8effe90
commit
1815597374
63 changed files with 1 additions and 0 deletions
39
ESPMegaPRO-firmware/lib/ESPMegaPRO/DigitalOutputIoT.hpp
Normal file
39
ESPMegaPRO-firmware/lib/ESPMegaPRO/DigitalOutputIoT.hpp
Normal file
|
@ -0,0 +1,39 @@
|
|||
#pragma once
|
||||
#include <IoTComponent.hpp>
|
||||
#include <ExpansionCard.hpp>
|
||||
#include <DigitalOutputCard.hpp>
|
||||
|
||||
class DigitalOutputIoT : public IoTComponent {
|
||||
public:
|
||||
DigitalOutputIoT();
|
||||
~DigitalOutputIoT();
|
||||
bool begin(uint8_t card_id, ExpansionCard *card, PubSubClient *mqtt, char *base_topic);
|
||||
void handleMqttMessage(char *topic, char *payload);
|
||||
void publishDigitalOutputs();
|
||||
void publishDigitalOutput(uint8_t pin);
|
||||
void publishDigitalOutputState(uint8_t pin);
|
||||
void publishDigitalOutputValue(uint8_t pin);
|
||||
void setDigitalOutputsPublishEnabled(bool enabled);
|
||||
void handleValueChange(uint8_t pin, bool state, uint16_t value);
|
||||
void registerChangeCallback(std::function<void(uint8_t, bool, uint16_t)> callback);
|
||||
void deregisterChangeCallback();
|
||||
void publishReport();
|
||||
void subscribe();
|
||||
void loop();
|
||||
uint8_t getType();
|
||||
private:
|
||||
bool digital_outputs_publish_enabled = false;
|
||||
bool processSetStateMessage(char *topic, char *payload, uint8_t topic_length);
|
||||
bool processSetValueMessage(char *topic, char *payload, uint8_t topic_length);
|
||||
bool processRequestStateMessage(char *topic, char *payload, uint8_t topic_length);
|
||||
std::function<void(uint8_t, bool, uint16_t)> value_change_callback;
|
||||
DigitalOutputCard *card;
|
||||
char *state_report_topic;
|
||||
char *value_report_topic;
|
||||
uint8_t set_state_length;
|
||||
uint8_t set_value_length;
|
||||
uint8_t state_length;
|
||||
uint8_t value_length;
|
||||
uint8_t request_state_length;
|
||||
uint8_t publish_enable_length;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue