#include <blocking_adapter.h>
UartBlockingAdapter provides the blocking Uart interface on top of a UartNonBlocking device.
◆ DoClearPendingReceiveBytes()
Status pw::uart::UartBlockingAdapter::DoClearPendingReceiveBytes |
( |
| ) |
|
|
inlineoverrideprivatevirtual |
◆ DoConservativeReadAvailable()
size_t pw::uart::UartBlockingAdapter::DoConservativeReadAvailable |
( |
| ) |
|
|
inlineoverrideprivatevirtual |
◆ DoEnable()
Status pw::uart::UartBlockingAdapter::DoEnable |
( |
bool |
enable | ) |
|
|
inlineoverrideprivatevirtual |
◆ DoFlushOutput()
Status pw::uart::UartBlockingAdapter::DoFlushOutput |
( |
| ) |
|
|
overrideprivatevirtual |
◆ DoSetBaudRate()
Status pw::uart::UartBlockingAdapter::DoSetBaudRate |
( |
uint32_t |
baud_rate | ) |
|
|
inlineoverrideprivatevirtual |
◆ DoSetFlowControl()
Status pw::uart::UartBlockingAdapter::DoSetFlowControl |
( |
bool |
enabled | ) |
|
|
inlineoverrideprivatevirtual |
◆ DoTryReadFor()
Reads data from the UART into a provided buffer with an optional timeout provided.
This virtual function attempts to read data into the provided byte buffer (rx_buffer
). The operation will continue until either min_bytes
have been read into the buffer, an error occurs, or the optional timeout duration expires.
- Parameters
-
rx_buffer | The buffer to read data into. |
min_bytes | The minimum number of bytes to read before returning. |
timeout | An optional timeout duration. If specified, the function will block for no longer than this duration. If zero, the function will immediately return with at least one hardware read operation attempt. If not specified, the function blocks until the buffer is full. |
- Returns
embed:rst:leading-asterisk
*
* .. pw-status-codes::
*
* OK: The operation was successful and the entire buffer has been
* filled with data.
*
* DEADLINE_EXCEEDED: The operation timed out before the entire buffer
* could be filled.
*
* May return other implementation-specific status codes.
*
*
Reimplemented from pw::uart::Uart.
◆ DoTryWriteFor()
Writes data from a provided buffer to the UART with an optional timeout.
This virtual function attempts to write data from the provided byte buffer (tx_buffer
) to the UART. The operation will continue until either the buffer is empty, an error occurs, or the optional timeout duration expires.
- Parameters
-
tx_buffer | The buffer containing data to be written. |
timeout | An optional timeout duration. If specified, the function will block for no longer than this duration. If zero, the function will immediately return after at least one hardware write operation attempt. If not specified, the function blocks until the buffer is empty. |
- Returns
embed:rst:leading-asterisk
*
* .. pw-status-codes::
*
* OK: The operation was successful and the entire buffer has been
* written.
*
* DEADLINE_EXCEEDED: The operation timed out before the entire buffer
* could be written.
*
* May return other implementation-specific status codes.
*
*
Implements pw::uart::Uart.
The documentation for this class was generated from the following file: