9 namespace remote_base {
14 for (
size_t i = 0; i < this->
len_; i++) {
44 void set_code_template(std::function<std::vector<int32_t>(Ts...)> func) { this->code_func_ = func; }
46 this->code_static_ = code;
47 this->code_static_len_ =
len;
49 TEMPLATABLE_VALUE(uint32_t, carrier_frequency);
52 if (this->code_static_ !=
nullptr) {
53 for (
size_t i = 0; i < this->code_static_len_; i++) {
54 auto val = this->code_static_[i];
56 dst->
space(static_cast<uint32_t>(-
val));
58 dst->
mark(static_cast<uint32_t>(
val));
62 dst->
set_data(this->code_func_(x...));
68 std::function<std::vector<int32_t>(Ts...)> code_func_{};
69 const int32_t *code_static_{
nullptr};
70 int32_t code_static_len_{0};
void set_code_template(std::function< std::vector< int32_t >(Ts...)> func)
void set_carrier_frequency(uint32_t carrier_frequency)
bool on_receive(RemoteReceiveData src) override
bool is_secondary() override
std::vector< int32_t > * get_raw_data()
bool expect_space(uint32_t length)
bool expect_mark(uint32_t length)
void mark(uint32_t length)
bool matches(RemoteReceiveData src) override
void set_data(const std::vector< int32_t > &data)
void encode(RemoteTransmitData *dst, Ts... x) override
void set_code_static(const int32_t *code, size_t len)
void space(uint32_t length)
void set_data(const int32_t *data)