diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index ac00d958d..e3dadda03 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -33,6 +33,7 @@ Release 3-dev - (wifi) - Fix flush operation on WifiMacQueues - (wifi) - #942 - Trace expired MPDUs before removing them from the queue to avoid blocking the recipient buffer - (wifi) - Fix wrong condition preventing PHY from aborting RX when starting TX +- (lr-wpan) - #944 - Fix for-loop in PrintTxQueue(s) functions Release 3.39 ------------ diff --git a/src/lr-wpan/model/lr-wpan-mac.cc b/src/lr-wpan/model/lr-wpan-mac.cc index 15100266d..93c0088ee 100644 --- a/src/lr-wpan/model/lr-wpan-mac.cc +++ b/src/lr-wpan/model/lr-wpan-mac.cc @@ -2932,34 +2932,37 @@ LrWpanMac::PurgeInd() } void -LrWpanMac::PrintPendTxQ(std::ostream& os) const +LrWpanMac::PrintPendingTxQueue(std::ostream& os) const { LrWpanMacHeader peekedMacHdr; os << "Pending Transaction List [" << GetShortAddress() << " | " << GetExtendedAddress() << "] | CurrentTime: " << Simulator::Now().As(Time::S) << "\n" - << " Destination | Sequence Number | Frame type | Expire time\n"; + << " Destination |" + << " Sequence Number |" + << " Frame type |" + << " Expire time\n"; - for (uint32_t i = 0; i < m_indTxQueue.size(); i++) + for (auto transaction : m_indTxQueue) { - m_indTxQueue[i]->txQPkt->PeekHeader(peekedMacHdr); - os << m_indTxQueue[i]->dstExtAddress << " " - << static_cast(m_indTxQueue[i]->seqNum) << " "; + transaction->txQPkt->PeekHeader(peekedMacHdr); + os << transaction->dstExtAddress << " " + << static_cast(transaction->seqNum) << " "; if (peekedMacHdr.IsCommand()) { - os << "Cmd Frame "; + os << " Command Frame "; } else if (peekedMacHdr.IsData()) { - os << "Data Frame "; + os << " Data Frame "; } else { - os << "Unk Frame "; + os << " Unknown Frame "; } - os << m_indTxQueue[i]->expireTime.As(Time::S) << "\n"; + os << transaction->expireTime.As(Time::S) << "\n"; } } @@ -2970,11 +2973,14 @@ LrWpanMac::PrintTxQueue(std::ostream& os) const os << "\nTx Queue [" << GetShortAddress() << " | " << GetExtendedAddress() << "] | CurrentTime: " << Simulator::Now().As(Time::S) << "\n" - << " Destination | Sequence Number | Dst PAN id | Frame type |\n"; + << " Destination |" + << " Sequence Number |" + << " Dst PAN id |" + << " Frame type |\n"; - for (uint32_t i = 0; i < m_indTxQueue.size(); i++) + for (auto transaction : m_txQueue) { - m_txQueue[i]->txQPkt->PeekHeader(peekedMacHdr); + transaction->txQPkt->PeekHeader(peekedMacHdr); os << "[" << peekedMacHdr.GetShortDstAddr() << "]" << ", [" << peekedMacHdr.GetExtDstAddr() << "] " @@ -2983,15 +2989,15 @@ LrWpanMac::PrintTxQueue(std::ostream& os) const if (peekedMacHdr.IsCommand()) { - os << "Cmd Frame "; + os << " Command Frame "; } else if (peekedMacHdr.IsData()) { - os << "Data Frame "; + os << " Data Frame "; } else { - os << "Unk Frame "; + os << " Unknown Frame "; } os << "\n"; diff --git a/src/lr-wpan/model/lr-wpan-mac.h b/src/lr-wpan/model/lr-wpan-mac.h index 02022f19e..7e4d3a90b 100644 --- a/src/lr-wpan/model/lr-wpan-mac.h +++ b/src/lr-wpan/model/lr-wpan-mac.h @@ -1584,7 +1584,7 @@ class LrWpanMac : public Object * Print the Pending transaction list. * \param os The reference to the output stream used by this print function. */ - void PrintPendTxQ(std::ostream& os) const; + void PrintPendingTxQueue(std::ostream& os) const; /** * Print the Transmit Queue.