ESPHome 2026.12.0-dev
Loading...
Searching...
No Matches
virtual_uart.cpp
Go to the documentation of this file.
1#include "virtual_uart.h"
2#include "esphome/core/log.h"
3
4#include <cinttypes>
5
7
8ESPHOME_LOG_TAG(TAG, "virtual_uart");
9
10void log_own_write_dropped() { ESP_LOGW(TAG, "on_tx wrote to its own UART, dropped"); }
11
12void log_inject_dropped(size_t len) { ESP_LOGW(TAG, "No room for %zu bytes in the RX buffer, dropped", len); }
13
15 ESP_LOGCONFIG(TAG,
16 "Virtual UART:\n"
17 " Baud Rate: %" PRIu32 " baud\n"
18 " Data Bits: %u\n"
19 " Parity: %s\n"
20 " Stop bits: %u\n"
21 " RX Buffer Size: %zu",
22 component->get_baud_rate(), component->get_data_bits(),
23 LOG_STR_ARG(uart::parity_to_str(component->get_parity())), component->get_stop_bits(),
24 component->get_rx_buffer_size());
25}
26
27} // namespace esphome::virtual_uart
const Component * component
Definition component.cpp:34
const LogString * parity_to_str(UARTParityOptions parity)
Definition uart.cpp:43
ESPHOME_LOG_TAG(TAG, "virtual_uart")
void log_inject_dropped(size_t len)
void dump_virtual_uart_config(uart::UARTComponent *component)
const void size_t len
Definition hal.h:68