Garmin Fleet Management Controller
2.19.0
|
Garmin serial packet. More...
#include <GarminPacket.h>
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 uint8 * | getRawBytes () |
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... | |
ApplicationLayer * | mSender |
The ApplicationLayer that originated this packet (for ACK callback) More... | |
time_t | mTxTime |
Time when the packet was last sent. More... | |
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.
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.
aId | The packet ID |
aPayloadData | The packet payload |
aPayloadSize | The size, in bytes, of the packet payload |
aSender | Application layer that constructed this packet |
Definition at line 22 of file GarminPacket.cpp.
|
virtual |
Destructor.
Definition at line 49 of file GarminPacket.cpp.
|
virtual |
Get the bytes in the raw frame.
Implements Packet.
Definition at line 67 of file GarminPacket.cpp.
References mFrame.
|
virtual |
Get the raw size of the frame, in bytes.
Implements Packet.
Definition at line 58 of file GarminPacket.cpp.
References mFrameSize.
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 |
A complete serial packet.
Garmin packet ID
Definition at line 44 of file GarminPacket.h.
Referenced by GarminLinkLayer::getPacketFromFifo(), FmiApplicationLayer::onAck(), GarminTransportLayer::rx(), FmiApplicationLayer::rx(), GarminLinkLayer::tx(), and GarminTransportLayer::tx().
uint8 GarminPacket::mPayload[MAX_PAYLOAD_SIZE] |
The payload, before DLE stuffing.
Definition at line 49 of file GarminPacket.h.
Referenced by GarminLinkLayer::getPacketFromFifo(), FmiApplicationLayer::onAck(), GarminTransportLayer::rx(), FmiApplicationLayer::rx(), GarminLinkLayer::tx(), and GarminTransportLayer::tx().
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.