5 namespace remote_base {
7 static const char *
const TAG =
"remote.haier";
9 constexpr uint32_t HEADER_LOW_US = 3100;
10 constexpr uint32_t HEADER_HIGH_US = 4400;
11 constexpr uint32_t BIT_MARK_US = 540;
12 constexpr uint32_t BIT_ONE_SPACE_US = 1650;
13 constexpr uint32_t BIT_ZERO_SPACE_US = 580;
17 for (uint8_t mask = 1 << 7; mask != 0; mask >>= 1) {
19 dst->
space(BIT_ONE_SPACE_US);
21 dst->
space(BIT_ZERO_SPACE_US);
23 dst->
mark(BIT_MARK_US);
30 dst->
mark(HEADER_LOW_US);
31 dst->
space(HEADER_LOW_US);
32 dst->
mark(HEADER_LOW_US);
33 dst->
space(HEADER_HIGH_US);
34 dst->
mark(BIT_MARK_US);
36 for (uint8_t item : data.
data) {
51 if (size < HAIER_IR_PACKET_BIT_SIZE * 2)
53 size = HAIER_IR_PACKET_BIT_SIZE * 2;
58 for (uint8_t mask = 0x80; mask != 0; mask >>= 1) {
71 out.
data.push_back(data);
72 }
else if (checksum != data) {
std::string format_hex_pretty(const uint8_t *data, size_t length)
Format the byte array data of length len in pretty-printed, human-readable hex.
void set_carrier_frequency(uint32_t carrier_frequency)
optional< HaierData > decode(RemoteReceiveData src) override
bool expect_space(uint32_t length)
bool expect_mark(uint32_t length)
void encode(RemoteTransmitData *dst, const HaierData &data) override
std::vector< uint8_t > data
void mark(uint32_t length)
void encode_byte_(RemoteTransmitData *dst, uint8_t item)
uint32_t get_index() const
constexpr unsigned int HAIER_IR_PACKET_BIT_SIZE
void space(uint32_t length)
Implementation of SPI Controller mode.
void reserve(uint32_t len)
bool expect_item(uint32_t mark, uint32_t space)
void dump(const HaierData &data) override