3#ifdef USE_UART_DEBUGGER
This class contains some static methods, that can be used to easily create a logging action for the d...
static void log_hex(UARTDirection direction, std::vector< uint8_t > bytes, uint8_t separator)
Log the bytes as hex values, separated by the provided separator character.
static void log_binary(UARTDirection direction, std::vector< uint8_t > bytes, uint8_t separator)
Log the bytes as '<binary> (<hex>)' values, separated by the provided separator.
static void log_string(UARTDirection direction, std::vector< uint8_t > bytes)
Log the bytes as string values, escaping unprintable characters.
static void log_int(UARTDirection direction, std::vector< uint8_t > bytes, uint8_t separator)
Log the bytes as integer values, separated by the provided separator character.
The UARTDebugger class adds debugging support to a UART bus.
void store_byte_(UARTDirection direction, uint8_t byte)
void set_after_timeout(uint32_t timeout)
Set a timeout for the data stream.
UARTDirection for_direction_
void trigger_after_timeout_()
bool is_my_direction_(UARTDirection direction)
void add_delimiter_byte(uint8_t byte)
Add a delimiter byte.
void trigger_after_direction_change_(UARTDirection direction)
void set_direction(UARTDirection direction)
Set the direction in which to inspect the bytes: incoming, outgoing or both.
void set_after_bytes(size_t size)
Set the maximum number of bytes to accumulate.
size_t after_delimiter_pos_
std::vector< uint8_t > bytes_
std::vector< uint8_t > after_delimiter_
void trigger_after_delimiter_(uint8_t byte)
bool has_buffered_bytes_()
void trigger_after_bytes_()
UARTDirection last_direction_
UARTDebugger(UARTComponent *parent)
This UARTDevice is used by the serial debugger to read data from a serial interface when the 'dummy_r...
UARTDummyReceiver(UARTComponent *parent)
Providing packet encoding functions for exchanging data with a remote host.