9static const char *
const TAG =
"remote_base";
16 const int32_t value = this->
peek(offset);
19 return value >= 0 && lo <= value && value <= hi;
25 const int32_t value = this->
peek(offset);
27 return value >= 0 && lo <= value;
33 const int32_t value = this->
peek(offset);
35 return value >= 0 && value <= hi;
41 const int32_t value = this->
peek(offset);
44 return value <= 0 && lo <= -value && -value <= hi;
50 const int32_t value = this->
peek(offset);
52 return value <= 0 && lo <= -value;
58 const int32_t value = this->
peek(offset);
60 return value <= 0 && -value <= hi;
118 bool success =
false;
119 for (
auto *dumper : this->
dumpers_) {
132#ifdef ESPHOME_LOG_HAS_VERY_VERBOSE
135 uint32_t buffer_offset = 0;
136 buffer_offset += sprintf(buffer,
"Sending times=%" PRIu32
" wait=%" PRIu32
"ms: ", send_times, send_wait);
138 for (
size_t i = 0; i < vec.size(); i++) {
139 const int32_t value = vec[i];
140 const uint32_t remaining_length =
sizeof(buffer) - buffer_offset;
143 if (i + 1 < vec.size()) {
144 written = snprintf(buffer + buffer_offset, remaining_length,
"%" PRId32
", ", value);
146 written = snprintf(buffer + buffer_offset, remaining_length,
"%" PRId32, value);
149 if (written < 0 || written >=
int(remaining_length)) {
151 buffer[buffer_offset] =
'\0';
152 ESP_LOGVV(TAG,
"%s", buffer);
154 written = sprintf(buffer,
" ");
155 if (i + 1 < vec.size()) {
156 written += sprintf(buffer + written,
"%" PRId32
", ", value);
158 written += sprintf(buffer + written,
"%" PRId32, value);
162 buffer_offset += written;
164 if (buffer_offset != 0) {
165 ESP_LOGVV(TAG,
"%s", buffer);
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_
std::vector< RemoteReceiverDumperBase * > dumpers_
std::vector< RemoteReceiverListener * > listeners_
void register_dumper(RemoteReceiverDumperBase *dumper)
std::vector< RemoteReceiverDumperBase * > secondary_dumpers_
virtual bool matches(RemoteReceiveData src)=0
bool on_receive(RemoteReceiveData src) override
void dump_config() override
virtual bool is_secondary()
const RawTimings & get_data() const
void send_(uint32_t send_times, uint32_t send_wait)
virtual void send_internal(uint32_t send_times, uint32_t send_wait)=0
RemoteTransmitData temp_
Use same vector for all transmits, avoids many allocations.
Providing packet encoding functions for exchanging data with a remote host.
void IRAM_ATTR HOT yield()