From 70863601366fa1f445b746ee644524273d577209 Mon Sep 17 00:00:00 2001 From: Alberto Gallegos Ramonet Date: Fri, 7 Feb 2025 17:27:59 +0900 Subject: [PATCH] zigbee: Add missing NwkStatus, JoinConfirmCallback --- src/zigbee/model/zigbee-nwk-tables.cc | 61 +++------------------------ src/zigbee/model/zigbee-nwk.cc | 4 ++ src/zigbee/model/zigbee-nwk.h | 39 ++++++++--------- 3 files changed, 30 insertions(+), 74 deletions(-) diff --git a/src/zigbee/model/zigbee-nwk-tables.cc b/src/zigbee/model/zigbee-nwk-tables.cc index b32ce8538..8b3117426 100644 --- a/src/zigbee/model/zigbee-nwk-tables.cc +++ b/src/zigbee/model/zigbee-nwk-tables.cc @@ -77,14 +77,7 @@ RreqRetryTableEntry::Print(Ptr stream) const *os << std::resetiosflags(std::ios::adjustfield) << std::setiosflags(std::ios::left); *os << std::setw(9) << static_cast(m_rreqId); *os << std::setw(12) << static_cast(m_rreqRetryCount); - if (m_rreqRetryEventId.IsPending()) - { - *os << std::setw(9) << "TRUE"; - } - else - { - *os << std::setw(9) << "FALSE"; - } + *os << std::setw(9) << (m_rreqRetryEventId.IsPending() ? "TRUE" : "FALSE"); *os << std::endl; (*os).copyfmt(oldState); } @@ -290,44 +283,11 @@ RoutingTableEntry::Print(Ptr stream) const break; } - if (m_noRouteCache) - { - *os << std::setw(16) << "TRUE"; - } - else - { - *os << std::setw(16) << "FALSE"; - } - - if (m_manyToOne) - { - *os << std::setw(16) << "TRUE"; - } - else - { - *os << std::setw(16) << "FALSE"; - } - - if (m_routeRecordReq) - { - *os << std::setw(16) << "TRUE"; - } - else - { - *os << std::setw(16) << "FALSE"; - } - - if (m_groupId) - { - *os << std::setw(16) << "TRUE"; - } - else - { - *os << std::setw(16) << "FALSE"; - } - + *os << std::setw(16) << (m_noRouteCache ? "TRUE" : "FALSE"); + *os << std::setw(16) << (m_manyToOne ? "TRUE" : "FALSE"); + *os << std::setw(16) << (m_routeRecordReq ? "TRUE" : "FALSE"); + *os << std::setw(16) << (m_groupId ? "TRUE" : "FALSE"); *os << std::endl; - (*os).copyfmt(oldState); } @@ -1027,16 +987,7 @@ NeighborTableEntry::Print(Ptr stream) const *os << std::setw(16) << static_cast(m_outgoingCost); *os << std::setw(8) << static_cast(m_age); *os << std::setw(19) << std::hex << m_extPanId << std::dec; - - if (m_potentialParent) - { - *os << std::setw(11) << "TRUE"; - } - else - { - *os << std::setw(11) << "FALSE"; - } - + *os << std::setw(11) << (m_potentialParent ? "TRUE" : "FALSE"); *os << std::endl; (*os).copyfmt(oldState); } diff --git a/src/zigbee/model/zigbee-nwk.cc b/src/zigbee/model/zigbee-nwk.cc index d855e61e7..cd76f0bdc 100644 --- a/src/zigbee/model/zigbee-nwk.cc +++ b/src/zigbee/model/zigbee-nwk.cc @@ -1305,6 +1305,7 @@ ZigbeeNwk::MlmeScanConfirm(MlmeScanConfirmParams params) { NlmeJoinConfirmParams joinConfirmParams; joinConfirmParams.m_status = NwkStatus::NO_NETWORKS; + m_nlmeJoinConfirmCallback(joinConfirmParams); } } } @@ -3131,6 +3132,9 @@ operator<<(std::ostream& os, const NwkStatus& state) case NwkStatus::INVALID_HANDLE: os << "INVALID HANDLE"; break; + case NwkStatus::INVALID_PARAMETER_MAC: + os << "INVALID PARAMETER MAC"; + break; case NwkStatus::NO_ACK: os << "NO ACKNOLEDGMENT"; break; diff --git a/src/zigbee/model/zigbee-nwk.h b/src/zigbee/model/zigbee-nwk.h index fd7b11105..6f8d74357 100644 --- a/src/zigbee/model/zigbee-nwk.h +++ b/src/zigbee/model/zigbee-nwk.h @@ -162,25 +162,26 @@ enum NwkStatus : std::uint8_t CHANNEL_ACCESS_FAILURE = 0xe1, //!< A Tx could not take place due to activity in the CH. DENIED = 0xe2, //!< The GTS request has been denied by the PAN coordinator. DISABLE_TRX_FAILURE = 0xe3, //!< The attempt to disable the transceier has failed. - SECURITY_ERROR = 0xe4, //!< Cryptographic process of the frame failed(FAILED_SECURITY_CHECK). - FRAME_TOO_LONG = 0xe5, //!< Frame more than aMaxPHYPacketSize or too large for CAP or GTS. - INVALID_GTS = 0xe6, //!< Missing GTS transmit or undefined direction. - INVALID_HANDLE = 0xe7, //!< When purging from TX queue handle was not found. - NO_ACK = 0xe9, //!< No acknowledgment was received after macMaxFrameRetries. - NO_BEACON = 0xea, //!< A scan operation failed to find any network beacons. - NO_DATA = 0xeb, //!< No response data were available following a request. - NO_SHORT_ADDRESS = 0xec, //!< Failure due to unallocated 16-bit short address. - OUT_OF_CAP = 0xed, //!< (Deprecated) See IEEE 802.15.4-2003 - PAN_ID_CONFLICT = 0xee, //!< PAN id conflict detected and informed to the coordinator. - REALIGMENT = 0xef, //!< A coordinator realigment command has been received. - TRANSACTION_EXPIRED = 0xf0, //!< The transaction expired and its information discarded. - TRANSACTION_OVERFLOW = 0xf1, //!< There is no capacity to store the transaction. - TX_ACTIVE = 0xf2, //!< The transceiver was already enabled. - UNAVAILABLE_KEY = 0xf3, //!< Unavailable key, unknown or blacklisted. - INVALID_ADDRESS = 0xf5, //!< Invalid source or destination address. - ON_TIME_TOO_LONG = 0xf6, //!< RX enable request fail due to syms. longer than Bcn. interval - PAST_TIME = 0xf7, //!< Rx enable request fail due to lack of time in superframe. - TRACKING_OFF = 0xf8, //!< This device is currently not tracking beacons. + SECURITY_ERROR = 0xe4, //!< Cryptographic process of the frame failed(FAILED_SECURITY_CHECK). + FRAME_TOO_LONG = 0xe5, //!< Frame more than aMaxPHYPacketSize or too large for CAP or GTS. + INVALID_GTS = 0xe6, //!< Missing GTS transmit or undefined direction. + INVALID_HANDLE = 0xe7, //!< When purging from TX queue handle was not found. + INVALID_PARAMETER_MAC = 0xe8, //!< Invalid parameter in response to a request passed to the MAC. + NO_ACK = 0xe9, //!< No acknowledgment was received after macMaxFrameRetries. + NO_BEACON = 0xea, //!< A scan operation failed to find any network beacons. + NO_DATA = 0xeb, //!< No response data were available following a request. + NO_SHORT_ADDRESS = 0xec, //!< Failure due to unallocated 16-bit short address. + OUT_OF_CAP = 0xed, //!< (Deprecated) See IEEE 802.15.4-2003 + PAN_ID_CONFLICT = 0xee, //!< PAN id conflict detected and informed to the coordinator. + REALIGMENT = 0xef, //!< A coordinator realigment command has been received. + TRANSACTION_EXPIRED = 0xf0, //!< The transaction expired and its information discarded. + TRANSACTION_OVERFLOW = 0xf1, //!< There is no capacity to store the transaction. + TX_ACTIVE = 0xf2, //!< The transceiver was already enabled. + UNAVAILABLE_KEY = 0xf3, //!< Unavailable key, unknown or blacklisted. + INVALID_ADDRESS = 0xf5, //!< Invalid source or destination address. + ON_TIME_TOO_LONG = 0xf6, //!< RX enable request fail due to syms. longer than Bcn. interval + PAST_TIME = 0xf7, //!< Rx enable request fail due to lack of time in superframe. + TRACKING_OFF = 0xf8, //!< This device is currently not tracking beacons. INVALID_INDEX = 0xf9, //!< A MAC PIB write failed because specified index is out of range. READ_ONLY = 0xfb, //!< SET/GET request issued for a read only attribute. SUPERFRAME_OVERLAP = 0xfd, //!< Coordinator sperframe and this device superframe tx overlap.