ESPHome
2024.9.2
esphome
esphome
components
remote_base
mirage_protocol.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/core/component.h
"
4
#include "
remote_base.h
"
5
6
namespace
esphome
{
7
namespace
remote_base {
8
9
struct
MirageData
{
10
std::vector<uint8_t>
data
;
11
12
bool
operator==
(
const
MirageData
&rhs)
const
{
return
data == rhs.
data
; }
13
};
14
15
class
MirageProtocol
:
public
RemoteProtocol
<MirageData> {
16
public
:
17
void
encode(
RemoteTransmitData
*dst,
const
MirageData
&
data
)
override
;
18
optional<MirageData>
decode(
RemoteReceiveData
src)
override
;
19
void
dump(
const
MirageData
&data)
override
;
20
21
protected
:
22
void
encode_byte_(
RemoteTransmitData
*dst, uint8_t item);
23
};
24
25
DECLARE_REMOTE_PROTOCOL
(Mirage)
26
27
template
<
typename
... Ts>
class
MirageAction :
public
RemoteTransmitterActionBase
<Ts...> {
28
public
:
29
TEMPLATABLE_VALUE(std::vector<uint8_t>, code)
30
31
void
encode(
RemoteTransmitData
*dst, Ts...
x
)
override
{
32
MirageData
data
{};
33
data
.data = this->code_.value(
x
...);
34
MirageProtocol
().
encode
(dst,
data
);
35
}
36
};
37
38
}
// namespace remote_base
39
}
// namespace esphome
esphome::remote_base::MirageProtocol::encode
void encode(RemoteTransmitData *dst, const MirageData &data) override
Definition:
mirage_protocol.cpp:17
esphome::remote_base::DECLARE_REMOTE_PROTOCOL
DECLARE_REMOTE_PROTOCOL(AEHA) template< typename... Ts > class AEHAAction
Definition:
aeha_protocol.h:27
x
uint16_t x
Definition:
tt21100.cpp:17
esphome::remote_base::MirageData::data
std::vector< uint8_t > data
Definition:
mirage_protocol.h:10
esphome::remote_base::RemoteTransmitData
Definition:
remote_base.h:25
esphome::remote_base::RemoteProtocol
Definition:
remote_base.h:225
esphome::remote_base::RemoteTransmitterActionBase
Definition:
remote_base.h:279
esphome::remote_base::RemoteReceiveData
Definition:
remote_base.h:48
esphome::optional
Definition:
optional.h:36
remote_base.h
esphome
Implementation of SPI Controller mode.
Definition:
a01nyub.cpp:7
esphome::remote_base::MirageProtocol
Definition:
mirage_protocol.h:15
component.h
esphome::remote_base::MirageData
Definition:
mirage_protocol.h:9
esphome::remote_base::MirageData::operator==
bool operator==(const MirageData &rhs) const
Definition:
mirage_protocol.h:12
Generated by
1.8.13