Garmin Fleet Management Controller  2.19.0
TransportLayer.h
Go to the documentation of this file.
1 /*********************************************************************
2 *
3 * HEADER NAME:
4 * TransportLayer.h
5 *
6 * Copyright 2009 by Garmin Ltd. or its subsidiaries.
7 *---------------------------------------------------------------------
8 * $NoKeywords$
9 *********************************************************************/
10 #ifndef TransportLayer_H
11 #define TransportLayer_H
12 
13 #include <list>
14 
15 class TransportLayer;
16 
17 #include "Packet.h"
18 #include "ApplicationLayer.h"
19 
20 //----------------------------------------------------------------------
27 //----------------------------------------------------------------------
29 {
30 public:
32  virtual ~TransportLayer();
33 
34  //----------------------------------------------------------------------
38  //----------------------------------------------------------------------
39  virtual void tx
40  (
41  Packet * aPacket,
42  bool aSendNow
43  ) = 0;
44 
45  //----------------------------------------------------------------------
47  //----------------------------------------------------------------------
48  virtual void retry() = 0;
49 
50  //----------------------------------------------------------------------
53  //----------------------------------------------------------------------
54  virtual void rx
55  (
56  Packet * aPacket
57  ) = 0;
58 
59  virtual void addAppLayer
60  (
61  ApplicationLayer * aAppLayer
62  );
63 
64  virtual void removeAppLayer
65  (
66  ApplicationLayer * aAppLayer
67  );
68 
69 protected:
71  typedef std::list<ApplicationLayer *> AppLayerList;
72 
75  AppLayerList mAppLayers;
76 };
77 
78 #endif
TransportLayer()
Constructor.
virtual void rx(Packet *aPacket)=0
Callback when a complete packet is assembled by the LinkLayer.
virtual void removeAppLayer(ApplicationLayer *aAppLayer)
Remove an app layer object from the callback list.
std::list< ApplicationLayer * > AppLayerList
A list of app layers that are connected to this link layer.
virtual void addAppLayer(ApplicationLayer *aAppLayer)
Add an app layer object to the callback list.
virtual ~TransportLayer()
Destructor.
Abstract base class for transport layer in the OSI model.
Abstract base class for a packet of data.
Definition: Packet.h:18
virtual void tx(Packet *aPacket, bool aSendNow)=0
Transmit a packet.
AppLayerList mAppLayers
The application layer objects that send/receive using this GarminTransportLayer.
virtual void retry()=0
Retry the last transmit.
Abstract base class for the application layer in the OSI model.