CRTP adapter that turns a BaseUart& into a transport the templated fdo2::Driver<UartT> can drive.
More...
#include <Fdo2Handler.h>
|
| | HalUartFdo2Comm (BaseUart &uart) noexcept |
| |
| void | write (const std::uint8_t *data, std::size_t length) noexcept |
| |
| std::size_t | read (std::uint8_t *out, std::size_t max, std::uint32_t timeout_ms) noexcept |
| |
| void | flush_rx () noexcept |
| |
| void | delay_ms_impl (std::uint32_t ms) noexcept |
| |
|
| BaseUart & | uart_ |
| |
| std::uint8_t | line_ [128] {} |
| | Reply being assembled; 128 bytes holds the longest reply (#MRAW with CRC, < 120).
|
| |
| std::size_t | line_len_ {0} |
| |
CRTP adapter that turns a BaseUart& into a transport the templated fdo2::Driver<UartT> can drive.
- Notes
read() returns one complete reply line, CR included, as the driver requires (a line without its CR is a ProtocolError), or 0 when no whole line arrived within the timeout. A partial line is kept for the next call; flush_rx() drops it. BaseUart::Read reports a status, not a count, so bytes are read one at a time while BytesAvailable() is non-zero.
- All timing (delays, deadline tracking) goes through the
hf-utils-rtos-wrap os_* primitives — the handler has zero direct ESP-IDF / FreeRTOS dependencies, so the same code path works against any RTOS the wrapper supports.
◆ HalUartFdo2Comm()
| HalUartFdo2Comm::HalUartFdo2Comm |
( |
BaseUart & |
uart | ) |
|
|
inlineexplicitnoexcept |
◆ delay_ms_impl()
| void HalUartFdo2Comm::delay_ms_impl |
( |
std::uint32_t |
ms | ) |
|
|
noexcept |
◆ flush_rx()
| void HalUartFdo2Comm::flush_rx |
( |
| ) |
|
|
noexcept |
◆ read()
| std::size_t HalUartFdo2Comm::read |
( |
std::uint8_t * |
out, |
|
|
std::size_t |
max, |
|
|
std::uint32_t |
timeout_ms |
|
) |
| |
|
noexcept |
◆ write()
| void HalUartFdo2Comm::write |
( |
const std::uint8_t * |
data, |
|
|
std::size_t |
length |
|
) |
| |
|
noexcept |
◆ line_
| std::uint8_t HalUartFdo2Comm::line_[128] {} |
|
private |
Reply being assembled; 128 bytes holds the longest reply (#MRAW with CRC, < 120).
◆ line_len_
| std::size_t HalUartFdo2Comm::line_len_ {0} |
|
private |
◆ uart_
| BaseUart& HalUartFdo2Comm::uart_ |
|
private |
The documentation for this class was generated from the following files: