9 PacketTransport::setup();
17 if (!data.is_contiguous()) {
18 ESP_LOGW(TAG,
"Packet split across buffers is not supported");
26 ESP_LOGD(TAG,
"Failed to send packet of %zu bytes", buf.size());
A buffer class that efficiently represents a composite buffer with three sections:
std::span< const uint8_t > as_span() const
Get the data as one span.
PacketInterface * top()
The topmost layer stacked on this one, or this one if nothing is stacked on it.
virtual bool send_to_interface(const PacketBuffer &data, const PacketMetaData &meta_data)=0
Method to be implemented by child classes to send data to the interface.
void add_packet_interface_listener(F &&callback)
Add a listener that will be called when data is received.
void send_packet(const std::vector< uint8_t > &buf) const override
void receive_(const PacketBuffer &data)
PacketInterface * interface_
void process_(std::span< const uint8_t > data)
Process a received packet.
ESPHOME_LOG_TAG(TAG, "packet_interface.session")