SSP21-CPP
Public Member Functions | Protected Member Functions | List of all members
ssp21::IUpperLayer Class Referenceabstract

Performs asynchronous RX/TX operations on behalf of an ILowerLayer. More...

#include <ssp21/stack/IUpperLayer.h>

Public Member Functions

bool on_lower_open ()
 Open the layer if it was closed. More...
 
bool on_lower_close ()
 Close the layer if it was open. More...
 
bool on_lower_tx_ready ()
 Called by the ILowerLayer when it's ready to transmit data. More...
 
bool on_lower_rx_ready ()
 Called by the ILowerLayer when new data is available. More...
 
bool is_open () const
 Check if layer is currently open. More...
 

Protected Member Functions

virtual void on_lower_open_impl ()=0
 Open the layer. More...
 
virtual void on_lower_close_impl ()=0
 Close the layer. More...
 
virtual void on_lower_tx_ready_impl ()=0
 Callback when ILowerLayer is ready to transmit data. More...
 
virtual void on_lower_rx_ready_impl ()=0
 Callback when ILowerLayer received data. More...
 

Detailed Description

Performs asynchronous RX/TX operations on behalf of an ILowerLayer.

This class is used by IStack. User of the library must implement this interface to send and receive the bytes to the host application.

Definition at line 17 of file IUpperLayer.h.

Member Function Documentation

◆ on_lower_open()

bool ssp21::IUpperLayer::on_lower_open ( )
inline

Open the layer if it was closed.

Returns
true
if the layer was originally closed,
false
otherwise.

Implementor of this class must implement IUpperLayer::on_lower_open_impl().

Definition at line 26 of file IUpperLayer.h.

◆ on_lower_close()

bool ssp21::IUpperLayer::on_lower_close ( )
inline

Close the layer if it was open.

Returns
true
if the layer was originally open,
false
otherwise.

Implementor of this class must implement IUpperLayer::on_lower_close_impl().

Definition at line 46 of file IUpperLayer.h.

◆ on_lower_tx_ready()

bool ssp21::IUpperLayer::on_lower_tx_ready ( )
inline

Called by the ILowerLayer when it's ready to transmit data.

Returns
true
if the layer is open,
false
otherwise.

Implementor of this class must implement IUpperLayer::on_lower_tx_ready_impl().

Definition at line 66 of file IUpperLayer.h.

◆ on_lower_rx_ready()

bool ssp21::IUpperLayer::on_lower_rx_ready ( )
inline

Called by the ILowerLayer when new data is available.

Returns
true
if the layer is open,
false
otherwise.

Implementor of this class must implement IUpperLayer::on_lower_rx_ready_impl().

Definition at line 85 of file IUpperLayer.h.

◆ is_open()

bool ssp21::IUpperLayer::is_open ( ) const
inline

Check if layer is currently open.

Returns
true
if the layer is open,
false
otherwise.

Definition at line 102 of file IUpperLayer.h.

◆ on_lower_open_impl()

virtual void ssp21::IUpperLayer::on_lower_open_impl ( )
protectedpure virtual

Open the layer.

See IUpperLayer::on_lower_open()

◆ on_lower_close_impl()

virtual void ssp21::IUpperLayer::on_lower_close_impl ( )
protectedpure virtual

Close the layer.

See IUpperLayer::on_lower_close()

◆ on_lower_tx_ready_impl()

virtual void ssp21::IUpperLayer::on_lower_tx_ready_impl ( )
protectedpure virtual

Callback when ILowerLayer is ready to transmit data.

See IUpperLayer::on_lower_tx_ready()

◆ on_lower_rx_ready_impl()

virtual void ssp21::IUpperLayer::on_lower_rx_ready_impl ( )
protectedpure virtual

Callback when ILowerLayer received data.

See IUpperLayer::on_lower_rx_ready()