Garmin Fleet Management Controller  2.19.0
TransportLayer Class Referenceabstract

Abstract base class for transport layer in the OSI model. More...

#include <TransportLayer.h>

+ Inheritance diagram for TransportLayer:

Public Member Functions

 TransportLayer ()
 Constructor. More...
 
virtual ~TransportLayer ()
 Destructor. More...
 
virtual void addAppLayer (ApplicationLayer *aAppLayer)
 Add an app layer object to the callback list. More...
 
virtual void removeAppLayer (ApplicationLayer *aAppLayer)
 Remove an app layer object from the callback list. More...
 
virtual void retry ()=0
 Retry the last transmit. More...
 
virtual void rx (Packet *aPacket)=0
 Callback when a complete packet is assembled by the LinkLayer. More...
 
virtual void tx (Packet *aPacket, bool aSendNow)=0
 Transmit a packet. More...
 

Protected Types

typedef std::list< ApplicationLayer * > AppLayerList
 A list of app layers that are connected to this link layer. More...
 

Protected Attributes

AppLayerList mAppLayers
 The application layer objects that send/receive using this GarminTransportLayer. More...
 

Detailed Description

Abstract base class for transport layer in the OSI model.

In the OSI model, the transport layer is responsible for the reliable delivery of packets to the partner device. It handles flow control (sending packets to the link layer at the appropriate rate) and error control (handling errors and retransmitting or timing out as appropriate).

Definition at line 28 of file TransportLayer.h.

Member Typedef Documentation

typedef std::list<ApplicationLayer *> TransportLayer::AppLayerList
protected

A list of app layers that are connected to this link layer.

Definition at line 71 of file TransportLayer.h.

Constructor & Destructor Documentation

TransportLayer::TransportLayer ( )

Constructor.

Definition at line 16 of file TransportLayer.cpp.

TransportLayer::~TransportLayer ( )
virtual

Destructor.

Definition at line 23 of file TransportLayer.cpp.

References addAppLayer().

Member Function Documentation

void TransportLayer::addAppLayer ( ApplicationLayer app)
virtual

Add an app layer object to the callback list.

Parameters
appThe ApplicationLayer to get packet notifications

Definition at line 32 of file TransportLayer.cpp.

References mAppLayers, and removeAppLayer().

Referenced by ApplicationLayer::ApplicationLayer(), and ~TransportLayer().

void TransportLayer::removeAppLayer ( ApplicationLayer app)
virtual

Remove an app layer object from the callback list.

Parameters
appThe ApplicationLayer that should no longer get packet notifications

Definition at line 45 of file TransportLayer.cpp.

References mAppLayers.

Referenced by addAppLayer(), and ApplicationLayer::~ApplicationLayer().

virtual void TransportLayer::retry ( )
pure virtual

Retry the last transmit.

Implemented in GarminTransportLayer.

Referenced by FmiApplicationLayer::clearError(), and FmiApplicationLayer::sendEnable().

virtual void TransportLayer::rx ( Packet aPacket)
pure virtual

Callback when a complete packet is assembled by the LinkLayer.

Parameters
aPacketThe packet that was received

Implemented in GarminTransportLayer.

Referenced by GarminLinkLayer::getPacketFromFifo().

virtual void TransportLayer::tx ( Packet aPacket,
bool  aSendNow 
)
pure virtual

Transmit a packet.

Parameters
aPacketThe packet to transmit
aSendNowIf true, the packet should be sent immediately (not FIFO)

Implemented in GarminTransportLayer.

Referenced by GarminLinkLayer::getPacketFromFifo(), FmiApplicationLayer::sendEnablePvtCommand(), FmiApplicationLayer::sendFreeformFmiPacket(), FmiApplicationLayer::txCommand(), and FmiApplicationLayer::txFmi().

Member Data Documentation

AppLayerList TransportLayer::mAppLayers
protected

The application layer objects that send/receive using this GarminTransportLayer.

Definition at line 75 of file TransportLayer.h.

Referenced by addAppLayer(), removeAppLayer(), GarminTransportLayer::rx(), and GarminTransportLayer::~GarminTransportLayer().


The documentation for this class was generated from the following files: