ESPHome 2026.1.0-dev
Loading...
Searching...
No Matches
uart_transport.h
Go to the documentation of this file.
1#pragma once
2
5#include <vector>
6#include "../uart.h"
7
8namespace esphome::uart {
9
19static const uint16_t MAX_PACKET_SIZE = 508;
20static const uint8_t FLAG_BYTE = 0x7E;
21static const uint8_t CONTROL_BYTE = 0x7D;
22
24 public:
25 void loop() override;
26 float get_setup_priority() const override { return setup_priority::PROCESSOR; }
27
28 protected:
29 void write_byte_(uint8_t byte) const;
30 void send_packet(const std::vector<uint8_t> &buf) const override;
31 bool should_send() override { return true; };
32 size_t get_max_packet_size() override { return MAX_PACKET_SIZE; }
33 std::vector<uint8_t> receive_buffer_{};
36};
37
38} // namespace esphome::uart
std::vector< uint8_t > receive_buffer_
size_t get_max_packet_size() override
void send_packet(const std::vector< uint8_t > &buf) const override
float get_setup_priority() const override
void write_byte_(uint8_t byte) const
Write a byte to the UART bus.
const float PROCESSOR
For components that use data from sensors like displays.
Definition component.cpp:82