#include <MockUart.h>
|
| using | OnWrite = std::function< void(MockUart &uart, const std::vector< uint8_t > &written)> |
| |
|
| | MockUart (hf_port_num_t port=0) noexcept |
| |
| | ~MockUart () noexcept override=default |
| |
| bool | Initialize () noexcept override |
| |
| bool | Deinitialize () noexcept override |
| |
| hf_uart_err_t | Write (const hf_u8_t *data, hf_u16_t length, hf_u32_t timeout_ms=0) noexcept override |
| |
| hf_uart_err_t | Read (hf_u8_t *data, hf_u16_t length, hf_u32_t timeout_ms=0) noexcept override |
| |
| hf_u16_t | BytesAvailable () noexcept override |
| |
| hf_uart_err_t | FlushTx () noexcept override |
| |
| hf_uart_err_t | FlushRx () noexcept override |
| |
| int | Printf (const char *format,...) noexcept override |
| |
| void | SetInitializeResult (bool ok) noexcept |
| |
| void | InjectRx (const std::vector< uint8_t > &bytes) |
| |
| void | InjectRx (const char *text) |
| |
| void | SetOnWrite (OnWrite on_write) |
| |
| void | FailNextWrite (hf_uart_err_t error, size_t count=1) noexcept |
| |
| const std::vector< uint8_t > & | TxBytes () const noexcept |
| |
| const std::vector< std::vector< uint8_t > > & | TxWrites () const noexcept |
| |
| void | ClearTx () noexcept |
| |
| int | FlushRxCalls () const noexcept |
| |
◆ OnWrite
◆ MockUart()
| hf::host::MockUart::MockUart |
( |
hf_port_num_t |
port = 0 | ) |
|
|
explicitnoexcept |
◆ ~MockUart()
| hf::host::MockUart::~MockUart |
( |
| ) |
|
|
overridedefaultnoexcept |
◆ BytesAvailable()
| hf_u16_t hf::host::MockUart::BytesAvailable |
( |
| ) |
|
|
overridenoexcept |
◆ ClearTx()
| void hf::host::MockUart::ClearTx |
( |
| ) |
|
|
noexcept |
◆ Deinitialize()
| bool hf::host::MockUart::Deinitialize |
( |
| ) |
|
|
inlineoverridenoexcept |
◆ FailNextWrite()
| void hf::host::MockUart::FailNextWrite |
( |
hf_uart_err_t |
error, |
|
|
size_t |
count = 1 |
|
) |
| |
|
noexcept |
◆ FlushRx()
| hf_uart_err_t hf::host::MockUart::FlushRx |
( |
| ) |
|
|
overridenoexcept |
◆ FlushRxCalls()
| int hf::host::MockUart::FlushRxCalls |
( |
| ) |
const |
|
inlinenoexcept |
◆ FlushTx()
| hf_uart_err_t hf::host::MockUart::FlushTx |
( |
| ) |
|
|
overridenoexcept |
◆ Initialize()
| bool hf::host::MockUart::Initialize |
( |
| ) |
|
|
inlineoverridenoexcept |
◆ InjectRx() [1/2]
| void hf::host::MockUart::InjectRx |
( |
const char * |
text | ) |
|
◆ InjectRx() [2/2]
| void hf::host::MockUart::InjectRx |
( |
const std::vector< uint8_t > & |
bytes | ) |
|
◆ Printf()
| int hf::host::MockUart::Printf |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
|
overridenoexcept |
◆ Read()
| hf_uart_err_t hf::host::MockUart::Read |
( |
hf_u8_t * |
data, |
|
|
hf_u16_t |
length, |
|
|
hf_u32_t |
timeout_ms = 0 |
|
) |
| |
|
overridenoexcept |
◆ SetInitializeResult()
| void hf::host::MockUart::SetInitializeResult |
( |
bool |
ok | ) |
|
|
inlinenoexcept |
◆ SetOnWrite()
| void hf::host::MockUart::SetOnWrite |
( |
OnWrite |
on_write | ) |
|
|
inline |
◆ TxBytes()
| const std::vector< uint8_t > & hf::host::MockUart::TxBytes |
( |
| ) |
const |
|
inlinenoexcept |
◆ TxWrites()
| const std::vector< std::vector< uint8_t > > & hf::host::MockUart::TxWrites |
( |
| ) |
const |
|
inlinenoexcept |
◆ Write()
| hf_uart_err_t hf::host::MockUart::Write |
( |
const hf_u8_t * |
data, |
|
|
hf_u16_t |
length, |
|
|
hf_u32_t |
timeout_ms = 0 |
|
) |
| |
|
overridenoexcept |
◆ fail_count_
| size_t hf::host::MockUart::fail_count_ {0} |
|
private |
◆ fail_error_
| hf_uart_err_t hf::host::MockUart::fail_error_ {hf_uart_err_t::UART_ERR_TRANSMISSION_FAILED} |
|
private |
◆ flush_rx_calls_
| int hf::host::MockUart::flush_rx_calls_ {0} |
|
private |
◆ init_result_
| bool hf::host::MockUart::init_result_ {true} |
|
private |
◆ on_write_
| OnWrite hf::host::MockUart::on_write_ |
|
private |
◆ rx_
| std::deque<uint8_t> hf::host::MockUart::rx_ |
|
private |
◆ tx_
| std::vector<uint8_t> hf::host::MockUart::tx_ |
|
private |
◆ writes_
| std::vector<std::vector<uint8_t> > hf::host::MockUart::writes_ |
|
private |
The documentation for this class was generated from the following files: