ESPHome 2025.5.0
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 {
9namespace uart {
10
20static const uint16_t MAX_PACKET_SIZE = 508;
21static const uint8_t FLAG_BYTE = 0x7E;
22static const uint8_t CONTROL_BYTE = 0x7D;
23
25 public:
26 void loop() override;
27 void update() override;
28 float get_setup_priority() const override { return setup_priority::PROCESSOR; }
29
30 protected:
31 void write_byte_(uint8_t byte) const;
32 void send_packet(const std::vector<uint8_t> &buf) const override;
33 bool should_send() override { return true; };
34 size_t get_max_packet_size() override { return MAX_PACKET_SIZE; }
35 std::vector<uint8_t> receive_buffer_{};
38};
39
40} // namespace uart
41} // namespace esphome
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:20
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7