70 mAppLayers.front()->disconnectTransportLayer();
109 ASSERT( thePacket != NULL );
170 AppLayerList::iterator iter;
173 if( (*iter)->rx( thePacket ) )
199 time( ¤tTime );
200 elapsed = difftime( currentTime,
mTransmitQueue.front()->mTxTime );
242 ASSERT( packet != NULL );
327 time( &packet->mTxTime );
virtual void tx(Packet *aPacket, bool aSendImmediate)
Transmit a Packet.
static GarminTransportLayer * sInstance
The one and only instance of this class.
void rx(Packet *aPacket)
Packet receive callback.
ApplicationLayer * mSender
The ApplicationLayer that originated this packet (for ACK callback)
bool mCommError
If true, a communication error has occurred (transmit is suspended)
PacketList mTransmitQueue
Queue of packets being transmitted; the head of the queue may have been sent but is not ACKed...
static void destroyInstance()
Delete the one and only GarminTransportLayer instance.
virtual void onTimer()
Periodic callback.
uint8 mChecksum
Twos-complement checksum of this packet.
virtual void onAck(const Packet *aPacket)=0
Callback when a sent packet is ACKed.
bool sendPacket()
Send a Packet.
GarminPacket * mLastNakSent
A copy of the most recently sent NAK.
uint8 mPayload[MAX_PAYLOAD_SIZE]
The payload, before DLE stuffing.
virtual ~GarminTransportLayer()
GarminTransportLayer destructor.
void setTransportLayer(TransportLayer *aTransport)
Set the transport layer.
id_type mPacketId
A complete serial packet.
Abstract base class for a packet of data.
virtual void retry()
Tries to resend the most recently sent packet.
AppLayerList mAppLayers
The application layer objects that send/receive using this GarminTransportLayer.
GarminLinkLayer * mLinkLayer
The link layer that frames are sent/received from.
Transport layer in the OSI communication model.
#define COM_TIMEOUT
timeout in seconds
uint8 mPayloadSize
Size of the payload, before DLE stuffing.
GarminTransportLayer()
Construct a GarminTransportLayer.
Link Layer in the OSI model.
GarminPacket * mLastAckSent
A copy of the most recently sent ACK.
virtual bool tx(Packet *aPacket)
Transmit a packet.
static GarminTransportLayer * getInstance()
Get the one and only GarminTransportLayer.
static void post(EventId aEventId, uint32 aEventData=0, void *aEventDataPtr=NULL, BOOL handleNow=FALSE)
Posts a message to all windows that have registered to get events.