![]() |
SSP21-CPP
|
Performs asynchronous RX/TX operations on behalf of an IUpperLayer. More...
#include <ssp21/stack/ILowerLayer.h>
Public Member Functions | |
virtual bool | is_tx_ready () const =0 |
Check if the layer is ready to transmit data. More... | |
virtual bool | start_tx_from_upper (const seq32_t &data)=0 |
Start an asynchronous TX operation. More... | |
seq32_t | start_rx_from_upper () |
Called by the IUpperLayer when it's ready to receive the next chunk of data. More... | |
Protected Member Functions | |
virtual void | discard_rx_data ()=0 |
Called when a previous ILowerLayer::start_rx_from_upper() operation completes. More... | |
virtual seq32_t | start_rx_from_upper_impl ()=0 |
Start reading data. More... | |
void | reset_this_lower_layer () |
Reset the layer. More... | |
bool | is_upper_processing_rx () const |
Check if the upper layer is waiting for RX data. More... | |
Performs asynchronous RX/TX operations on behalf of an IUpperLayer.
This class is used by IStack. User of the library must implement this interface to send and receive the bytes on the wire.
Definition at line 19 of file ILowerLayer.h.
|
pure virtual |
Check if the layer is ready to transmit data.
|
pure virtual |
Start an asynchronous TX operation.
data | Bytes to be transmitted |
Once the operation is successfully completed, the implementor must call IUpperLayer::on_lower_tx_ready().
The underlying buffer pointed to by data
is loaned out to this layer and must not be mutated until IUpperLayer::on_lower_tx_ready() is called.
|
inline |
Called by the IUpperLayer when it's ready to receive the next chunk of data.
The returned slice must remain valid until the next call or until the IUpperLayer is closed.
Implementor of this class must implement ILowerLayer::start_rx_from_upper_impl().
Definition at line 49 of file ILowerLayer.h.
|
protectedpure virtual |
Called when a previous ILowerLayer::start_rx_from_upper() operation completes.
Notifies that the buffer containing the RX data can be flushed.
|
protectedpure virtual |
Start reading data.
When bytes arrive, the implementor must call IUpperLayer::on_lower_rx_ready().
The returned slice must remain valid until the next call or until the IUpperLayer is closed.
|
inlineprotected |
Reset the layer.
This method cancels all pending RX and TX operations.
Definition at line 93 of file ILowerLayer.h.
|
inlineprotected |
Check if the upper layer is waiting for RX data.
Definition at line 102 of file ILowerLayer.h.