ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
drayton_protocol.h
Go to the documentation of this file.
1#pragma once
2
4#include "remote_base.h"
5
6#include <cinttypes>
7
8namespace esphome::remote_base {
9
11 uint16_t address;
12 uint8_t channel;
13 uint8_t command;
14 uint8_t data; // last, so positional initializers written for the legacy layout keep their meaning
15
16 // channel/command: legacy split of the same bits, filled on decode, ignored by operator==
17 bool operator==(const DraytonData &rhs) const { return address == rhs.address && data == rhs.data; }
18};
19
20class DraytonProtocol : public RemoteProtocol<DraytonData> {
21 public:
22 void encode(RemoteTransmitData *dst, const DraytonData &data);
23 optional<DraytonData> decode(RemoteReceiveData src);
24 void dump(const DraytonData &data);
25};
26
27DECLARE_REMOTE_PROTOCOL(Drayton)
28
29} // namespace esphome::remote_base
optional< DraytonData > decode(RemoteReceiveData src)
void encode(RemoteTransmitData *dst, const DraytonData &data)
void dump(const DraytonData &data)
const void * src
Definition hal.h:68
bool operator==(const DraytonData &rhs) const