#ifndef RF433_H #define RF433_H #include #include"writepin.h" class WirelessRelay { public: static constexpr uint16_t LARGE_TIME = 750; static constexpr uint8_t SMALL_TIME = 250; static constexpr uint16_t MAX_NAME_LENGTH = 16; private: bool _state = false; uint16_t _id; char _name[MAX_NAME_LENGTH]; void sendBit(const bool i); void sync(); void sendId(); public: WirelessRelay(const uint16_t id, char nameIn[]); WirelessRelay(); void init(const uint16_t id, char nameIn[]); void on(); void off(); char* getName(); void setName(char* name); uint16_t getId(); bool getExpectedState(); void resend(); }; #endif