9static constexpr uint8_t MISMATCH_COUNT = 10;
13 "Packet Interface '%s':\n"
14 " Max Packet Size: %zu",
19#ifdef ESPHOME_LOG_HAS_VERBOSE
20 static constexpr size_t LOG_BYTES = 24;
21 uint8_t head[LOG_BYTES];
22 size_t len = data.copy_to(head, LOG_BYTES);
23 ESP_LOGV_HEX(TAG, head,
len, LOG_BYTES,
"%s: received %zu bytes %s", this->
name_, data.
size());
34 ESP_LOGW(TAG,
"%s: %u packets in a row could not be understood; check that both ends have the same layers",
35 this->
name_, MISMATCH_COUNT);
A buffer class that efficiently represents a composite buffer with three sections:
size_t size() const
Get the total size of the buffer.
size_t get_max_packet_size() const
The largest packet this layer accepts; fixed when the layer is constructed.
void note_received_(bool understood)
Called by a layer for each received packet it understood, or could not make sense of.
uint8_t not_understood_count_
LazyCallbackManager< void(const PacketBuffer &, const PacketMetaData &)> callback_
void dump_config() override
void on_receive_from_interface_(const PacketBuffer &data, const PacketMetaData &meta_data)
This function should be called by implementing classes with received data to be passed to any listene...
ESPHOME_LOG_TAG(TAG, "packet_interface.session")