103#ifdef REMOTE_BASE_LISTENER_COUNT
105 if (this->
listeners_.size() == REMOTE_BASE_LISTENER_COUNT) {
106 ESP_LOGE(TAG,
"No listener slot: register it from to_code() with remote_base.add_listener");
113#ifdef REMOTE_BASE_DUMPER_COUNT
127 uint8_t secondaries = 0;
129 secondaries += dumper->is_secondary();
130 if (secondaries > 1) {
131 ESP_LOGW(TAG,
"Only the first of %u secondary dumpers runs", secondaries);
137#ifdef REMOTE_BASE_LISTENER_COUNT
141#ifdef REMOTE_BASE_DUMPER_COUNT
142 bool success =
false;
144 for (
auto *dumper : this->
dumpers_) {
145 if (dumper->is_secondary()) {
146 if (secondary ==
nullptr)
152 if (!success && secondary !=
nullptr)
163 this->
data_.reserve(count);
170 for (; consumed <
len && consumed < 5; consumed++) {
171 uint8_t
byte = data[consumed];
172 raw |= (
byte & 0x7F) << shift;
173 if ((
byte & 0x80) == 0) {
183 int32_t decoded =
static_cast<int32_t
>((
raw >> 1) ^ (~(
raw & 1) + 1));
184 this->
data_.push_back(decoded);
204 encode(call.get_data(), data);
205 call.set_send_times(send_times);
206 call.set_send_wait(send_wait);
211#ifdef ESPHOME_LOG_HAS_VERY_VERBOSE
215 "Sending times=%" PRIu32
" wait=%" PRIu32
"ms: ", send_times, send_wait);
217 for (
size_t i = 0; i < vec.size(); i++) {
218 const int32_t
value = vec[i];
219 size_t prev_pos =
pos;
221 if (i + 1 < vec.size()) {
230 ESP_LOGVV(TAG,
"%s",
buffer);
231 if (i + 1 < vec.size()) {
239 ESP_LOGVV(TAG,
"%s",
buffer);
243#ifdef USE_IR_RF_TRANSMIT_COMPLETE
void publish_state(bool new_state)
Publish a new state to the front-end.
bool peek_mark_at_most(uint32_t length, uint32_t offset=0) const
bool expect_item(uint32_t mark, uint32_t space)
bool peek_space(uint32_t length, uint32_t offset=0) const
bool peek_space_at_most(uint32_t length, uint32_t offset=0) const
int32_t peek(uint32_t offset=0) const
bool peek_item(uint32_t mark, uint32_t space, uint32_t offset=0) const
bool expect_space(uint32_t length)
int32_t upper_bound_(uint32_t length) const
bool expect_mark(uint32_t length)
bool is_valid(uint32_t offset=0) const
void advance(uint32_t amount=1)
bool peek_space_at_least(uint32_t length, uint32_t offset=0) const
int32_t lower_bound_(uint32_t length) const
bool peek_mark(uint32_t length, uint32_t offset=0) const
bool expect_pulse_with_gap(uint32_t mark, uint32_t space)
bool peek_mark_at_least(uint32_t length, uint32_t offset=0) const
ToleranceMode tolerance_mode_
void call_listeners_dumpers_()
void register_dumper(RemoteReceiverDumperBase *dumper)
For C++ registration, also from setup(); each call copies the list to the heap.
ConstVector< RemoteReceiverDumperBase *, true > dumpers_
void set_dumpers(RemoteReceiverDumperBase *const *dumpers, size_t count)
Codegen only (remote_base.add_dumper): the table must outlive this receiver.
void warn_extra_secondaries_()
void register_listener(RemoteReceiverListener *listener)
StaticVector< RemoteReceiverListener *, REMOTE_BASE_LISTENER_COUNT > listeners_
virtual bool matches(RemoteReceiveData src)=0
bool on_receive(RemoteReceiveData src) override
void dump_config() override
virtual bool dump(RemoteReceiveData src)=0
bool set_data_from_base64url(const std::string &base64url)
Set data from base64url-encoded little-endian int32 values Base64url is URL-safe: uses '-' instead of...
const RawTimings & get_data() const
void set_data_from_packed_sint32(const uint8_t *data, size_t len, size_t count)
Set data from packed protobuf sint32 buffer (zigzag + varint encoded)
void send_(uint32_t send_times, uint32_t send_wait, uint16_t seq)
void(*)(RemoteTransmitData *dst, const void *data) EncodeFn
virtual void send_internal(uint32_t send_times, uint32_t send_wait)=0
void transmit_encoded_(EncodeFn encode, const void *data, uint32_t send_times, uint32_t send_wait)
RemoteTransmitData temp_
Use same vector for all transmits, avoids many allocations.
virtual void flush_pending_completion()
Platforms that report completion later wait out the previous frame here, before send_() assigns the n...
ESPHOME_LOG_TAG(TAG, "remote.abbwelcome")
bool base64_decode_int32_vector(const std::string &base64, std::vector< int32_t > &out)
Decode base64/base64url string directly into vector of little-endian int32 values.