lr-wpan: (fixes #944) Fix for-loop in PrintTxQueue(s) functions

This commit is contained in:
Alberto Gallegos Ramonet
2023-08-25 11:29:38 +09:00
parent 781e37e40c
commit bb1e79423a
3 changed files with 24 additions and 17 deletions

View File

@@ -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
------------

View File

@@ -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<uint32_t>(m_indTxQueue[i]->seqNum) << " ";
transaction->txQPkt->PeekHeader(peekedMacHdr);
os << transaction->dstExtAddress << " "
<< static_cast<uint32_t>(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";

View File

@@ -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.