ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
uart_packet_interface.h
Go to the documentation of this file.
1#pragma once
2
3#include <span>
4
7
8namespace esphome::uart {
9
18 public:
21 explicit UartPacketInterface(std::span<uint8_t> rx_buffer)
22 : packet_interface::PacketInterface(rx_buffer.size()), rx_buffer_(rx_buffer) {}
23
24 void loop() override;
26 const packet_interface::PacketMetaData &meta_data) override;
27
28 protected:
29 void handle_rx_byte_(uint8_t byte);
30 const std::span<uint8_t> rx_buffer_;
31 size_t rx_length_{0};
34};
35
36} // namespace esphome::uart
A buffer class that efficiently represents a composite buffer with three sections:
A class that will transport data to and from an abstract channel.
A struct to hold metadata about a packet.
A packet interface for sending and receiving framed packets over a UART connection.
const std::span< uint8_t > rx_buffer_
bool send_to_interface(const packet_interface::PacketBuffer &data, const packet_interface::PacketMetaData &meta_data) override
UartPacketInterface(std::span< uint8_t > rx_buffer)
uint16_t size
Definition helpers.cpp:34