From ef212ceb9b0e73f5cdd0fe10a57bb92ae85b0796 Mon Sep 17 00:00:00 2001 From: Alberto Gallegos Ramonet Date: Thu, 26 Oct 2023 13:16:44 +0900 Subject: [PATCH] lr-wpan: Adds attributes to MLME-GET.request --- src/lr-wpan/model/lr-wpan-mac.cc | 6 ++++++ src/lr-wpan/model/lr-wpan-mac.h | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/lr-wpan/model/lr-wpan-mac.cc b/src/lr-wpan/model/lr-wpan-mac.cc index 07ce69394..24a4a1863 100644 --- a/src/lr-wpan/model/lr-wpan-mac.cc +++ b/src/lr-wpan/model/lr-wpan-mac.cc @@ -964,6 +964,12 @@ LrWpanMac::MlmeGetRequest(LrWpanMacPibAttributeIdentifier id) case macPanId: attributes->macPanId = m_macPanId; break; + case pCurrentChannel: + attributes->pCurrentChannel = m_phy->GetCurrentChannelNum(); + break; + case pCurrentPage: + attributes->pCurrentPage = m_phy->GetCurrentPage(); + break; default: status = MLMEGET_UNSUPPORTED_ATTRIBUTE; break; diff --git a/src/lr-wpan/model/lr-wpan-mac.h b/src/lr-wpan/model/lr-wpan-mac.h index a44b33c5a..f0b4bab26 100644 --- a/src/lr-wpan/model/lr-wpan-mac.h +++ b/src/lr-wpan/model/lr-wpan-mac.h @@ -348,6 +348,8 @@ enum LrWpanMacPibAttributeIdentifier macShortAddress = 2, macExtendedAddress = 3, macPanId = 4, + pCurrentChannel = 100, + pCurrentPage = 101, unsupported = 255 // TODO: complete other MAC pib attributes }; @@ -363,7 +365,9 @@ struct LrWpanMacPibAttributes : public SimpleRefCount uint8_t macBeaconPayloadLength{0}; //!< The length in octets of the beacon payload. Mac16Address macShortAddress; //!< The 16 bit mac short address Mac64Address macExtendedAddress; //!< The EUI-64 bit address - uint16_t macPanId; //!< The identifier of the PAN + uint16_t macPanId{0xffff}; //!< The identifier of the PAN + uint8_t pCurrentChannel{11}; //!< The current logical channel in used in the PHY + uint8_t pCurrentPage{0}; //!< The current logical page in use in the PHY // TODO: complete other MAC pib attributes };