Add Trace to measure the number of packet retires (for Etx metric)

This commit is contained in:
Tommaso Pecorella committed 2014-04-18 23:32:55 +02:00
1 parent 0595ff6824
commit ceee6c24fe
2 files changed
+23

No files matched your search

+12
View File
@@ -83,6 +83,9 @@ LrWpanMac::GetTypeId (void)
.AddTraceSource ("MacState",
"The state of LrWpan Mac",
MakeTraceSourceAccessor (&LrWpanMac::m_macStateLogger))
.AddTraceSource ("MacSentPkt",
"Trace source reporting some information about the sent packet",
MakeTraceSourceAccessor (&LrWpanMac::m_sentPktTrace))
;
return tid;
}
@@ -669,6 +672,15 @@ LrWpanMac::RemoveFirstTxQElement (void)
{
TxQueueElement *txQElement = m_txQueue.front ();
Ptr<const Packet> p = txQElement->txQPkt;
Ptr<Packet> pkt = p->Copy ();
LrWpanMacHeader hdr;
pkt->RemoveHeader (hdr);
if (hdr.GetShortDstAddr () != Mac16Address ("ff:ff"))
{
m_sentPktTrace (p, m_retransmission+1, 0);
}
txQElement->txQPkt = 0;
delete txQElement;
m_txQueue.pop_front ();
+11
View File
@@ -312,6 +312,17 @@ private:
bool PrepareRetransmission (void);
void CheckQueue (void);
/**
* The trace source fired when packets are considered as successfully sent
* or the transmission has been given up.
* Only non-broadcast packets are traced.
*
* The data should represent:
* packet, number of retries, total number of csma backoffs (not currently implemented)
*
* \see class CallBackTraceSource
*/
TracedCallback<Ptr<const Packet>, uint8_t, uint8_t > m_sentPktTrace;
TracedCallback<Ptr<const Packet>, bool> m_macTxQueueTrace;
/**