lr-wpan: DoDispose SIGSEGV and beacon fixes

This MR. fix 3 points:

  • In a recent MR, some elements were introduced to the MAC's DoDispose() function to ensure objects are completely disposed of before the end of the simulation. Unfortunately, an incorrect assignation of a Mac16Address and Mac64Address object to a nullptr caused a Segmentation fault error at the end of any simulation using Lr-WPAN. This patch fixes that problem.
    //in LrWpanMac::DoDispose()

    for (uint32_t i = 0; i < m_indTxQueue.size(); i++)
    {
        m_indTxQueue[i]->txQPkt = nullptr;
        m_indTxQueue[i]->seqNum = 0; // unnecessary
        m_indTxQueue[i]->dstExtAddress = nullptr; // segmentation fault, dstExtAddress is not a pointer
        m_indTxQueue[i]->dstShortAddress = nullptr; // segmentation fault, dstShortAddress is not a pointer
    }
  • Beacons can be used and received even in non-beacon-enabled mode. The current MAC incorrectly triggers the execution of the contention access period(CAP) on the reception of any kind of beacon even if the MAC is in non-beacon mode. This patch fixes this problem

  • Finally, an operator overload was included in the MAC to see the MAC state enum values in debug prints. This makes debugging much easier and makes it possible to catch other potential errors still circulating in the MAC.

CHANGES.md will be modified before the final merge.

Edited by Alberto Gallegos

Merge request reports

Loading