Garmin Fleet Management Controller  2.19.0
GarminPacket Class Reference

Garmin serial packet. More...

#include <GarminPacket.h>

+ Inheritance diagram for GarminPacket:

Public Member Functions

 GarminPacket ()
 Construct an empty Garmin RS232 packet. More...
 
 GarminPacket (id_type aId, uint8 *aPayloadData=NULL, uint8 aPayloadSize=0, ApplicationLayer *aSender=NULL)
 Construct a Garmin RS232 packet. More...
 
virtual ~GarminPacket ()
 Destructor. More...
 
virtual const uint8getRawBytes ()
 Get the bytes in the raw frame. More...
 
virtual uint32 getRawSize ()
 Get the raw size of the frame, in bytes. More...
 

Public Attributes

uint8 mChecksum
 Twos-complement checksum of this packet. More...
 
uint8 mFrame [MAX_PACKET_SIZE]
 The packet as transmitted on the serial link (with DLE stuffing) More...
 
uint16 mFrameSize
 Number of bytes in the packet, with header, footer, and DLE stuffing. More...
 
id_type mPacketId
 A complete serial packet. More...
 
uint8 mPayload [MAX_PAYLOAD_SIZE]
 The payload, before DLE stuffing. More...
 
uint8 mPayloadSize
 Size of the payload, before DLE stuffing. More...
 
ApplicationLayermSender
 The ApplicationLayer that originated this packet (for ACK callback) More...
 
time_t mTxTime
 Time when the packet was last sent. More...
 

Detailed Description

Garmin serial packet.

Encapsulates a Garmin serial packet (packet ID, payload data, payload size) along with related data needed to track the packet's state (sender application for onAck, and transmit time to detect timeouts).

Definition at line 26 of file GarminPacket.h.

Constructor & Destructor Documentation

GarminPacket::GarminPacket ( )

Construct an empty Garmin RS232 packet.

Definition at line 38 of file GarminPacket.cpp.

GarminPacket::GarminPacket ( id_type  aId,
uint8 aPayloadData = NULL,
uint8  aPayloadSize = 0,
ApplicationLayer aSender = NULL 
)

Construct a Garmin RS232 packet.

Parameters
aIdThe packet ID
aPayloadDataThe packet payload
aPayloadSizeThe size, in bytes, of the packet payload
aSenderApplication layer that constructed this packet

Definition at line 22 of file GarminPacket.cpp.

GarminPacket::~GarminPacket ( )
virtual

Destructor.

Definition at line 49 of file GarminPacket.cpp.

Member Function Documentation

const uint8 * GarminPacket::getRawBytes ( )
virtual

Get the bytes in the raw frame.

Returns
Pointer to the raw frame

Implements Packet.

Definition at line 67 of file GarminPacket.cpp.

References mFrame.

uint32 GarminPacket::getRawSize ( )
virtual

Get the raw size of the frame, in bytes.

Returns
The number of bytes in the raw frame

Implements Packet.

Definition at line 58 of file GarminPacket.cpp.

References mFrameSize.

Member Data Documentation

uint8 GarminPacket::mChecksum

Twos-complement checksum of this packet.

Definition at line 48 of file GarminPacket.h.

Referenced by GarminLinkLayer::getPacketFromFifo(), GarminLinkLayer::tx(), and GarminTransportLayer::tx().

uint8 GarminPacket::mFrame[MAX_PACKET_SIZE]

The packet as transmitted on the serial link (with DLE stuffing)

Definition at line 50 of file GarminPacket.h.

Referenced by GarminLinkLayer::getPacketFromFifo(), getRawBytes(), and GarminLinkLayer::tx().

uint16 GarminPacket::mFrameSize

Number of bytes in the packet, with header, footer, and DLE stuffing.

Definition at line 47 of file GarminPacket.h.

Referenced by GarminLinkLayer::getPacketFromFifo(), getRawSize(), and GarminLinkLayer::tx().

id_type GarminPacket::mPacketId
uint8 GarminPacket::mPayloadSize

Size of the payload, before DLE stuffing.

Definition at line 46 of file GarminPacket.h.

Referenced by GarminLinkLayer::getPacketFromFifo(), FmiApplicationLayer::rx(), GarminLinkLayer::tx(), and GarminTransportLayer::tx().

ApplicationLayer* GarminPacket::mSender

The ApplicationLayer that originated this packet (for ACK callback)

Definition at line 51 of file GarminPacket.h.

Referenced by GarminTransportLayer::rx().

time_t GarminPacket::mTxTime

Time when the packet was last sent.

Definition at line 45 of file GarminPacket.h.


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