Garmin Fleet Management Controller  2.19.0
LinkLayer.h
Go to the documentation of this file.
1 /*********************************************************************
2 *
3 * HEADER NAME:
4 * LinkLayer.h
5 *
6 * Copyright 2008-2009 by Garmin Ltd. or its subsidiaries.
7 *---------------------------------------------------------------------
8 * $NoKeywords$
9 *********************************************************************/
10 #ifndef LinkLayer_H
11 #define LinkLayer_H
12 
13 class LinkLayer;
14 
15 #include "PhysicalLayer.h"
16 #include "TransportLayer.h"
17 #include "Packet.h"
18 
19 //----------------------------------------------------------------------
25 //----------------------------------------------------------------------
26 class LinkLayer
27 {
28 
29 public:
30  //----------------------------------------------------------------------
37  //----------------------------------------------------------------------
38  virtual bool tx
39  (
40  Packet * aPacket
41  ) = 0;
42 
43  //----------------------------------------------------------------------
51  //----------------------------------------------------------------------
52  virtual void rx
53  (
54  uint8 const * const aData,
55  uint32 const aSize
56  ) = 0;
57 
58  void setPhysicalLayer
59  (
60  PhysicalLayer * aPort
61  );
62 
64  (
65  TransportLayer * aTransport
66  );
67 
68 protected:
69  LinkLayer();
70 
71  virtual ~LinkLayer();
72 
75 
78 };
79 
80 #endif
Abstract base class for the physical layer.
Definition: PhysicalLayer.h:25
Abstract base class for link Layers in the OSI model.
Definition: LinkLayer.h:26
virtual bool tx(Packet *aPacket)=0
Transmit data to the physical layer.
LinkLayer()
Construct a LinkLayer.
Definition: LinkLayer.cpp:18
PhysicalLayer * mPhysicalLayer
The serial port that this link layer communicates with.
Definition: LinkLayer.h:74
void setTransportLayer(TransportLayer *aTransport)
Set the transport layer.
Definition: LinkLayer.cpp:55
Abstract base class for transport layer in the OSI model.
Abstract base class for a packet of data.
Definition: Packet.h:18
virtual void rx(uint8 const *const aData, uint32 const aSize)=0
Receive data from the physical layer.
TransportLayer * mTransportLayer
The transport layer that this link layer communicates with.
Definition: LinkLayer.h:77
unsigned char uint8
8-bit unsigned integer
Definition: garmin_types.h:62
void setPhysicalLayer(PhysicalLayer *aPort)
Set the physical layer.
Definition: LinkLayer.cpp:41
virtual ~LinkLayer()
Destructor.
Definition: LinkLayer.cpp:28
unsigned long int uint32
32-bit unsigned integer
Definition: garmin_types.h:66