ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
esphome::serial_proxy Namespace Reference

Data Structures

class  SerialProxy
 
class  SerialProxyTap
 Observes a port's traffic without owning it, and may inject bytes of its own. More...
 

Enumerations

enum  SerialProxyLineStateFlag : uint32_t { SERIAL_PROXY_LINE_STATE_FLAG_RTS = 1 << 0 , SERIAL_PROXY_LINE_STATE_FLAG_DTR = 1 << 1 }
 Bit flags for the line_states field exchanged with API clients. More...
 
enum class  SerialProxyResult : uint8_t {
  SERIAL_PROXY_RESULT_OK , SERIAL_PROXY_RESULT_ASSUMED_SUCCESS , SERIAL_PROXY_RESULT_PORT_IN_USE , SERIAL_PROXY_RESULT_INVALID_ARGUMENT ,
  SERIAL_PROXY_RESULT_ERROR , SERIAL_PROXY_RESULT_TIMEOUT , SERIAL_PROXY_RESULT_NOT_SUPPORTED
}
 Result of a client-initiated operation; mapped to api::enums::SerialProxyStatus by the API layer. More...
 

Functions

 ESPHOME_LOG_TAG (TAG, "serial_proxy")
 
void __attribute__ ((noinline)) SerialProxy
 

Variables

constexpr size_t SERIAL_PROXY_MAX_READ_SIZE = 256
 Maximum bytes to read from UART in a single loop iteration.
 
constexpr uint32_t SERIAL_PROXY_MAX_WRITE_STALL_MS = 1000
 Longest main-loop stall client writes may cause per loop pass, shared by every instance; bytes the UART cannot buffer within it are dropped.
 

Enumeration Type Documentation

◆ SerialProxyLineStateFlag

Bit flags for the line_states field exchanged with API clients.

Bit positions are stable API — new signals must use the next available bit.

Enumerator
SERIAL_PROXY_LINE_STATE_FLAG_RTS 

RTS (Request To Send)

SERIAL_PROXY_LINE_STATE_FLAG_DTR 

DTR (Data Terminal Ready)

Definition at line 52 of file serial_proxy.h.

◆ SerialProxyResult

enum class esphome::serial_proxy::SerialProxyResult : uint8_t
strong

Result of a client-initiated operation; mapped to api::enums::SerialProxyStatus by the API layer.

Enumerator
SERIAL_PROXY_RESULT_OK 

Operation completed or request accepted.

SERIAL_PROXY_RESULT_ASSUMED_SUCCESS 

Platform cannot confirm TX drain; success assumed.

SERIAL_PROXY_RESULT_PORT_IN_USE 

Denied: another live client holds the port.

SERIAL_PROXY_RESULT_INVALID_ARGUMENT 

A parameter value is out of range.

SERIAL_PROXY_RESULT_ERROR 

Driver or hardware error.

SERIAL_PROXY_RESULT_TIMEOUT 

Timed out before TX completed.

SERIAL_PROXY_RESULT_NOT_SUPPORTED 

Requested feature is not available on this instance.

Definition at line 58 of file serial_proxy.h.

Function Documentation

◆ __attribute__()

void esphome::serial_proxy::__attribute__ ( (noinline) )

Definition at line 114 of file serial_proxy.cpp.

◆ ESPHOME_LOG_TAG()

esphome::serial_proxy::ESPHOME_LOG_TAG ( TAG ,
"serial_proxy"  )

Variable Documentation

◆ SERIAL_PROXY_MAX_READ_SIZE

size_t esphome::serial_proxy::SERIAL_PROXY_MAX_READ_SIZE = 256
inlineconstexpr

Maximum bytes to read from UART in a single loop iteration.

Definition at line 69 of file serial_proxy.h.

◆ SERIAL_PROXY_MAX_WRITE_STALL_MS

uint32_t esphome::serial_proxy::SERIAL_PROXY_MAX_WRITE_STALL_MS = 1000
inlineconstexpr

Longest main-loop stall client writes may cause per loop pass, shared by every instance; bytes the UART cannot buffer within it are dropped.

Well under the shortest watchdog timeout, since the API hands the proxies up to ten writes in one pass.

Definition at line 74 of file serial_proxy.h.