14 const int32_t value = this->
peek(offset);
17 return value >= 0 && lo <= value && value <= hi;
23 const int32_t value = this->
peek(offset);
25 return value >= 0 && lo <= value;
31 const int32_t value = this->
peek(offset);
33 return value >= 0 && value <= hi;
39 const int32_t value = this->
peek(offset);
42 return value <= 0 && lo <= -value && -value <= hi;
48 const int32_t value = this->
peek(offset);
50 return value <= 0 && lo <= -value;
56 const int32_t value = this->
peek(offset);
58 return value <= 0 && -value <= hi;
103#ifdef REMOTE_BASE_LISTENER_COUNT
105 if (this->
listeners_.size() == REMOTE_BASE_LISTENER_COUNT) {
106 ESP_LOGE(TAG,
"No %s slot: register it from to_code() with remote_base.add_%s", LOG_STR_LITERAL(
"listener"),
107 LOG_STR_LITERAL(
"listener"));
114#ifdef REMOTE_BASE_DUMPER_COUNT
121 }
else if (this->
dumpers_.size() != REMOTE_BASE_DUMPER_COUNT) {
125 ESP_LOGE(TAG,
"No %s slot: register it from to_code() with remote_base.add_%s", LOG_STR_LITERAL(
"dumper"),
126 LOG_STR_LITERAL(
"dumper"));
131#ifdef REMOTE_BASE_LISTENER_COUNT
135#ifdef REMOTE_BASE_DUMPER_COUNT
136 bool success =
false;
137 for (
auto *dumper : this->
dumpers_) {
152 this->
data_.reserve(count);
159 for (; consumed <
len && consumed < 5; consumed++) {
160 uint8_t
byte = data[consumed];
161 raw |= (
byte & 0x7F) << shift;
162 if ((
byte & 0x80) == 0) {
172 int32_t decoded =
static_cast<int32_t
>((
raw >> 1) ^ (~(
raw & 1) + 1));
173 this->
data_.push_back(decoded);
193 encode(call.get_data(), data);
194 call.set_send_times(send_times);
195 call.set_send_wait(send_wait);
200#ifdef ESPHOME_LOG_HAS_VERY_VERBOSE
204 "Sending times=%" PRIu32
" wait=%" PRIu32
"ms: ", send_times, send_wait);
206 for (
size_t i = 0; i < vec.size(); i++) {
207 const int32_t value = vec[i];
208 size_t prev_pos =
pos;
210 if (i + 1 < vec.size()) {
219 ESP_LOGVV(TAG,
"%s",
buffer);
220 if (i + 1 < vec.size()) {
221 pos = buf_append_printf(
buffer,
sizeof(
buffer), 0,
" %" PRId32
", ", value);
223 pos = buf_append_printf(
buffer,
sizeof(
buffer), 0,
" %" PRId32, value);
228 ESP_LOGVV(TAG,
"%s",
buffer);
232#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)
StaticVector< RemoteReceiverDumperBase *, REMOTE_BASE_DUMPER_COUNT > dumpers_
void register_listener(RemoteReceiverListener *listener)
RemoteReceiverDumperBase * secondary_dumper_
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 is_secondary()
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.