From 1308223390c60f90c2cf167697eff588b9863635 Mon Sep 17 00:00:00 2001 From: jmartinez-silabs <67972863+jmartinez-silabs@users.noreply.github.com> Date: Wed, 24 Nov 2021 21:14:24 -0500 Subject: [PATCH] Thread Diagnostic cluster - Encode structs and list attributes and fix issues (#12181) * Fix thread Diag ResetCounts to only reset overruns. TODO track in some way overruns * Encode missing list and struct attributes, Tally Overrun Errors and fix reset, Fix RoutingRole to match Matter spec. Fix channel attribute type in the xlm * regen * Fix Shadow parameter error, when using encoder for the lists encoding * Fix getting a Route table for Thread_MTD * rebase regen * remove commented code * Regen again due to generated issue with bridge code * rebase®en * address requested change for REED detection * Fix FTD/REED logic * rebase regen to fix conflicts again --- .../thread_network_diagnostics_server.cpp | 9 +- .../thread-network-diagnostics-cluster.xml | 5 +- .../java/zap-generated/CHIPClusters-JNI.cpp | 4 +- .../zap-generated/CHIPClustersRead-JNI.cpp | 4 +- .../python/chip/clusters/CHIPClusters.cpp | 4 +- .../CHIP/zap-generated/CHIPClustersObjc.mm | 8 +- .../zap-generated/CHIPTestClustersObjc.mm | 2 +- ...nericThreadStackManagerImpl_OpenThread.cpp | 232 +++++++++++++----- ...GenericThreadStackManagerImpl_OpenThread.h | 8 + ...ThreadStackManagerImpl_OpenThread_LwIP.cpp | 5 + .../zap-generated/endpoint_config.h | 8 +- .../zap-generated/attributes/Accessors.cpp | 22 +- .../zap-generated/attributes/Accessors.h | 4 +- .../zap-generated/cluster-objects.h | 6 +- .../zap-generated/endpoint_config.h | 8 +- .../zap-generated/cluster/Commands.h | 8 +- .../zap-generated/reporting/Commands.h | 6 +- .../zap-generated/CHIPClusters.cpp | 4 +- .../zap-generated/tests/CHIPClustersTest.cpp | 2 +- .../zap-generated/tests/CHIPClustersTest.h | 2 +- .../zap-generated/endpoint_config.h | 8 +- .../lock-app/zap-generated/endpoint_config.h | 8 +- .../pump-app/zap-generated/endpoint_config.h | 8 +- .../zap-generated/endpoint_config.h | 8 +- .../zap-generated/endpoint_config.h | 8 +- .../tv-app/zap-generated/endpoint_config.h | 8 +- .../zap-generated/endpoint_config.h | 8 +- .../zap-generated/endpoint_config.h | 8 +- 28 files changed, 268 insertions(+), 147 deletions(-) diff --git a/src/app/clusters/thread_network_diagnostics_server/thread_network_diagnostics_server.cpp b/src/app/clusters/thread_network_diagnostics_server/thread_network_diagnostics_server.cpp index a7024e656d7b89..8e5ff031f72d16 100644 --- a/src/app/clusters/thread_network_diagnostics_server/thread_network_diagnostics_server.cpp +++ b/src/app/clusters/thread_network_diagnostics_server/thread_network_diagnostics_server.cpp @@ -82,15 +82,8 @@ bool emberAfThreadNetworkDiagnosticsClusterResetCountsCallback(app::CommandHandl const app::ConcreteCommandPath & commandPath, const Commands::ResetCounts::DecodableType & commandData) { - EmberAfStatus status = ThreadNetworkDiagnostics::Attributes::OverrunCount::Set(commandPath.mEndpointId, 0); - if (status != EMBER_ZCL_STATUS_SUCCESS) - { - ChipLogError(Zcl, "Failed to reset OverrunCount attribute"); - } - ConnectivityMgr().ResetThreadNetworkDiagnosticsCounts(); - - emberAfSendImmediateDefaultResponse(status); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS); return true; } diff --git a/src/app/zap-templates/zcl/data-model/chip/thread-network-diagnostics-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/thread-network-diagnostics-cluster.xml index 0e5d309ae84abc..2fbb445b9a235c 100644 --- a/src/app/zap-templates/zcl/data-model/chip/thread-network-diagnostics-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/thread-network-diagnostics-cluster.xml @@ -91,12 +91,11 @@ limitations under the License. 0x0035 THREAD_NETWORK_DIAGNOSTICS_CLUSTER The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems - channel + channel RoutingRole NetworkName PanId ExtendedPanId - MeshLocalPrefix OverrunCount @@ -154,11 +153,9 @@ limitations under the License. ActiveTimestamp PendingTimestamp delay - SecurityPolicy ChannelMask - OperationalDatasetComponents ActiveNetworkFaultsList diff --git a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp index 0bd024f10db59d..77a09cf738e851 100644 --- a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp @@ -30500,8 +30500,8 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportChannelAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); + std::unique_ptr onReport( + Platform::New(callback, true), Platform::Delete); VerifyOrReturn(onReport.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); diff --git a/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp index 7cd5f849aceefe..bdfc5352879140 100644 --- a/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp @@ -13880,8 +13880,8 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readChannelAttribute) { chip::DeviceLayer::StackLock lock; using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::Channel::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), chip::Platform::Delete); + std::unique_ptr onSuccess( + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); diff --git a/src/controller/python/chip/clusters/CHIPClusters.cpp b/src/controller/python/chip/clusters/CHIPClusters.cpp index ce72576070353d..0974f520d5e662 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.cpp +++ b/src/controller/python/chip/clusters/CHIPClusters.cpp @@ -10795,7 +10795,7 @@ chip::ChipError::StorageType chip_ime_ReadAttribute_ThreadNetworkDiagnostics_Cha VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); chip::Controller::ThreadNetworkDiagnosticsCluster cluster; cluster.Associate(device, ZCLendpointId); - return cluster.ReadAttributeChannel(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); + return cluster.ReadAttributeChannel(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); } chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostics_Channel(chip::DeviceProxy * device, @@ -10807,7 +10807,7 @@ chip::ChipError::StorageType chip_ime_SubscribeAttribute_ThreadNetworkDiagnostic chip::Controller::ThreadNetworkDiagnosticsCluster cluster; cluster.Associate(device, ZCLendpointId); return cluster - .SubscribeAttributeChannel(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .SubscribeAttributeChannel(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) .AsInteger(); } diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm index ad5b6cee16150c..afe00a0ffdf0b0 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -20410,14 +20410,14 @@ new CHIPCommandSuccessCallbackBridge( - (void)readAttributeChannelWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt8uAttributeCallbackBridge( + new CHIPInt16uAttributeCallbackBridge( self.callbackQueue, ^(NSError * _Nullable error, id _Nullable value) { completionHandler(value, error); }, ^(Cancelable * success, Cancelable * failure) { using TypeInfo = ThreadNetworkDiagnostics::Attributes::Channel::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); }); @@ -20427,14 +20427,14 @@ - (void)subscribeAttributeChannelWithMinInterval:(uint16_t)minInterval maxInterval:(uint16_t)maxInterval responseHandler:(ResponseHandler)responseHandler { - new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { return self.cppCluster.SubscribeAttributeChannel(success, failure, minInterval, maxInterval); }); } - (void)reportAttributeChannelWithResponseHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))responseHandler { - new CHIPInt8uAttributeCallbackBridge( + new CHIPInt16uAttributeCallbackBridge( self.callbackQueue, ^(NSError * _Nullable error, id _Nullable value) { responseHandler(value, error); diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm index 879bccbd2b0706..6262114cd1c964 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm @@ -6980,7 +6980,7 @@ new CHIPDefaultSuccessCallbackBridge( ListFreer listFreer; using TypeInfo = ThreadNetworkDiagnostics::Attributes::Channel::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = value.unsignedShortValue; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp index 92ea4cec28f0db..c01a2ab101dcab 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp @@ -793,10 +793,8 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_GetExternalIPv6 template void GenericThreadStackManagerImpl_OpenThread::_ResetThreadNetworkDiagnosticsCounts(void) { - // Reset MAC counters - otLinkResetCounters(mOTInst); - otThreadResetMleCounters(mOTInst); - otThreadResetIp6Counters(mOTInst); + // Based on the spec, only OverrunCount should be resetted. + mOverrunCount = 0; } /* * @brief Get runtime value from the thread network based on the given attribute ID. @@ -826,8 +824,46 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_WriteThreadNetw break; case ThreadNetworkDiagnostics::Attributes::RoutingRole::Id: { - otDeviceRole role = otThreadGetDeviceRole(mOTInst); - err = encoder.Encode(static_cast(role)); + ThreadNetworkDiagnostics::RoutingRole routingRole; + otDeviceRole otRole = otThreadGetDeviceRole(mOTInst); + + if (otRole == OT_DEVICE_ROLE_DISABLED) + { + routingRole = EMBER_ZCL_ROUTING_ROLE_UNSPECIFIED; + } + else if (otRole == OT_DEVICE_ROLE_DETACHED) + { + routingRole = EMBER_ZCL_ROUTING_ROLE_UNASSIGNED; + } + else if (otRole == OT_DEVICE_ROLE_ROUTER) + { + routingRole = EMBER_ZCL_ROUTING_ROLE_ROUTER; + } + else if (otRole == OT_DEVICE_ROLE_LEADER) + { + routingRole = EMBER_ZCL_ROUTING_ROLE_LEADER; + } + else if (otRole == OT_DEVICE_ROLE_CHILD) + { + otLinkModeConfig linkMode = otThreadGetLinkMode(mOTInst); + + if (linkMode.mRxOnWhenIdle) + { + routingRole = EMBER_ZCL_ROUTING_ROLE_END_DEVICE; +#if CHIP_DEVICE_CONFIG_THREAD_FTD + if (otThreadIsRouterEligible(mOTInst)) + { + routingRole = EMBER_ZCL_ROUTING_ROLE_REED; + } +#endif + } + else + { + routingRole = EMBER_ZCL_ROUTING_ROLE_SLEEPY_END_DEVICE; + } + } + + err = encoder.Encode(static_cast(routingRole)); } break; @@ -861,41 +897,96 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_WriteThreadNetw break; case ThreadNetworkDiagnostics::Attributes::OverrunCount::Id: { - // TO DO - err = CHIP_ERROR_NOT_IMPLEMENTED; + uint64_t overrunCount = mOverrunCount; + err = encoder.Encode(overrunCount); } break; case ThreadNetworkDiagnostics::Attributes::NeighborTableList::Id: { - err = encoder.Encode(DataModel::List()); - - // TO DO When list is functionnal. - // Determined limit of otNeighborInfo list - // pReadLength = sizeof(otNeighborInfo) * 20; - // buffer = static_cast(chip::Platform::MemoryAlloc(*pReadLength)); - // VerifyOrExit(*buffer != NULL, err = CHIP_ERROR_NO_MEMORY); + err = encoder.EncodeList([this](const TagBoundEncoder & aEncoder) -> CHIP_ERROR { + otNeighborInfo neighInfo; + otNeighborInfoIterator iterator = OT_NEIGHBOR_INFO_ITERATOR_INIT; - // otNeighborInfoIterator iterator = OT_NEIGHBOR_INFO_ITERATOR_INIT; - // otNeighborInfo neighInfo; - - // uint16_t remainingSize = *pReadLength; - // uint16_t offset = 0; - // while (otThreadGetNextNeighborInfo(mOTInst, &iterator, &neighInfo) == OT_ERROR_NONE) - // { - // if (remainingSize < sizeof(otNeighborInfo)) - // { - // break; - // } + while (otThreadGetNextNeighborInfo(mOTInst, &iterator, &neighInfo) == OT_ERROR_NONE) + { + ThreadNetworkDiagnostics::Structs::NeighborTable::Type neighborTable; + + neighborTable.extAddress = Encoding::BigEndian::Get64(neighInfo.mExtAddress.m8); + neighborTable.age = neighInfo.mAge; + neighborTable.rloc16 = neighInfo.mRloc16; + neighborTable.linkFrameCounter = neighInfo.mLinkFrameCounter; + neighborTable.mleFrameCounter = neighInfo.mMleFrameCounter; + neighborTable.lqi = neighInfo.mLinkQualityIn; + neighborTable.averageRssi = neighInfo.mAverageRssi; + neighborTable.lastRssi = neighInfo.mLastRssi; + neighborTable.frameErrorRate = neighInfo.mFrameErrorRate; + neighborTable.messageErrorRate = neighInfo.mMessageErrorRate; + neighborTable.rxOnWhenIdle = neighInfo.mRxOnWhenIdle; + neighborTable.fullThreadDevice = neighInfo.mFullThreadDevice; + neighborTable.fullNetworkData = neighInfo.mFullNetworkData; + neighborTable.isChild = neighInfo.mIsChild; + + ReturnErrorOnFailure(aEncoder.Encode(neighborTable)); + } - // memcpy(*buffer + offset, &neighInfo, sizeof(otNeighborInfo)); - // remainingSize -= sizeof(otNeighborInfo); - // offset += sizeof(otNeighborInfo); - // } + return CHIP_NO_ERROR; + }); } break; case ThreadNetworkDiagnostics::Attributes::RouteTableList::Id: { - err = encoder.Encode(DataModel::List()); + err = encoder.EncodeList([this](const TagBoundEncoder & aEncoder) -> CHIP_ERROR { + otRouterInfo routerInfo; + +#if CHIP_DEVICE_CONFIG_THREAD_FTD + uint8_t maxRouterId = otThreadGetMaxRouterId(mOTInst); + CHIP_ERROR chipErr = CHIP_ERROR_INCORRECT_STATE; + + for (uint8_t i = 0; i <= maxRouterId; i++) + { + if (otThreadGetRouterInfo(mOTInst, i, &routerInfo) == OT_ERROR_NONE) + { + ThreadNetworkDiagnostics::Structs::RouteTable::Type routeTable; + + routeTable.extAddress = Encoding::BigEndian::Get64(routerInfo.mExtAddress.m8); + routeTable.rloc16 = routerInfo.mRloc16; + routeTable.routerId = routerInfo.mRouterId; + routeTable.nextHop = routerInfo.mNextHop; + routeTable.pathCost = routerInfo.mPathCost; + routeTable.LQIIn = routerInfo.mLinkQualityIn; + routeTable.LQIOut = routerInfo.mLinkQualityOut; + routeTable.age = routerInfo.mAge; + routeTable.allocated = routerInfo.mAllocated; + routeTable.linkEstablished = routerInfo.mLinkEstablished; + + ReturnErrorOnFailure(aEncoder.Encode(routeTable)); + chipErr = CHIP_NO_ERROR; + } + } + + return chipErr; + +#else // OPENTHREAD_MTD + otError otErr = otThreadGetParentInfo(mOTInst, &routerInfo); + ReturnErrorOnFailure(MapOpenThreadError(otErr)); + + ThreadNetworkDiagnostics::Structs::RouteTable::Type routeTable; + + routeTable.extAddress = Encoding::BigEndian::Get64(routerInfo.mExtAddress.m8); + routeTable.rloc16 = routerInfo.mRloc16; + routeTable.routerId = routerInfo.mRouterId; + routeTable.nextHop = routerInfo.mNextHop; + routeTable.pathCost = routerInfo.mPathCost; + routeTable.LQIIn = routerInfo.mLinkQualityIn; + routeTable.LQIOut = routerInfo.mLinkQualityOut; + routeTable.age = routerInfo.mAge; + routeTable.allocated = routerInfo.mAllocated; + routeTable.linkEstablished = routerInfo.mLinkEstablished; + + ReturnErrorOnFailure(aEncoder.Encode(routeTable)); + return CHIP_NO_ERROR; +#endif + }); } break; @@ -1221,16 +1312,24 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_WriteThreadNetw break; case ThreadNetworkDiagnostics::Attributes::SecurityPolicy::Id: { - err = encoder.Encode(DataModel::List()); + err = CHIP_ERROR_INCORRECT_STATE; - // Stuct type nopt yet supported - // if (otDatasetIsCommissioned(mOTInst)) - // { - // otOperationalDataset activeDataset; - // otError otErr = otDatasetGetActive(mOTInst, &activeDataset); - // VerifyOrExit(otErr == OT_ERROR_NONE, err = MapOpenThreadError(otErr)); - // activeDataset.mSecurityPolicy - // } + if (otDatasetIsCommissioned(mOTInst)) + { + otOperationalDataset activeDataset; + otError otErr = otDatasetGetActive(mOTInst, &activeDataset); + VerifyOrExit(otErr == OT_ERROR_NONE, err = MapOpenThreadError(otErr)); + + ThreadNetworkDiagnostics::Structs::SecurityPolicy::Type securityPolicy; + static_assert(sizeof(securityPolicy) == sizeof(activeDataset.mSecurityPolicy), + "securityPolicy Struct do not match otSecurityPolicy"); + memcpy(&securityPolicy, &activeDataset.mSecurityPolicy, sizeof(securityPolicy)); + + err = encoder.EncodeList([securityPolicy](const TagBoundEncoder & aEncoder) -> CHIP_ERROR { + ReturnErrorOnFailure(aEncoder.Encode(securityPolicy)); + return CHIP_NO_ERROR; + }); + } } break; @@ -1258,27 +1357,46 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_WriteThreadNetw break; case ThreadNetworkDiagnostics::Attributes::OperationalDatasetComponents::Id: { - err = encoder.Encode(DataModel::List()); - - // Structure not yet supported - // if (otDatasetIsCommissioned(mOTInst)) - // { - // *pReadLength = sizeof(otOperationalDatasetComponents); - // *buffer = static_cast(chip::Platform::MemoryAlloc(*pReadLength)); - // VerifyOrExit(*buffer != NULL, err = CHIP_ERROR_NO_MEMORY); - - // otOperationalDataset activeDataset; - // otError otErr = otDatasetGetActive(mOTInst, &activeDataset); - // VerifyOrExit(otErr == OT_ERROR_NONE, err = MapOpenThreadError(otErr)); - // // TODO encode TLV STRUCT with content of activeDataset.mComponents - - // } - err = CHIP_ERROR_NOT_IMPLEMENTED; + err = CHIP_ERROR_INCORRECT_STATE; + if (otDatasetIsCommissioned(mOTInst)) + { + otOperationalDataset activeDataset; + otError otErr = otDatasetGetActive(mOTInst, &activeDataset); + VerifyOrExit(otErr == OT_ERROR_NONE, err = MapOpenThreadError(otErr)); + ThreadNetworkDiagnostics::Structs::OperationalDatasetComponents::Type OpDatasetComponents; + + OpDatasetComponents.activeTimestampPresent = activeDataset.mComponents.mIsActiveTimestampPresent; + OpDatasetComponents.pendingTimestampPresent = activeDataset.mComponents.mIsPendingTimestampPresent; + OpDatasetComponents.masterKeyPresent = activeDataset.mComponents.mIsNetworkKeyPresent; + OpDatasetComponents.networkNamePresent = activeDataset.mComponents.mIsNetworkNamePresent; + OpDatasetComponents.extendedPanIdPresent = activeDataset.mComponents.mIsExtendedPanIdPresent; + OpDatasetComponents.meshLocalPrefixPresent = activeDataset.mComponents.mIsMeshLocalPrefixPresent; + OpDatasetComponents.delayPresent = activeDataset.mComponents.mIsDelayPresent; + OpDatasetComponents.panIdPresent = activeDataset.mComponents.mIsPanIdPresent; + OpDatasetComponents.channelPresent = activeDataset.mComponents.mIsChannelPresent; + OpDatasetComponents.pskcPresent = activeDataset.mComponents.mIsPskcPresent; + OpDatasetComponents.securityPolicyPresent = activeDataset.mComponents.mIsSecurityPolicyPresent; + OpDatasetComponents.channelMaskPresent = activeDataset.mComponents.mIsChannelMaskPresent; + + err = encoder.EncodeList([OpDatasetComponents](const TagBoundEncoder & aEncoder) -> CHIP_ERROR { + ReturnErrorOnFailure(aEncoder.Encode(OpDatasetComponents)); + return CHIP_NO_ERROR; + }); + } } break; case ThreadNetworkDiagnostics::Attributes::ActiveNetworkFaultsList::Id: { - err = encoder.Encode(DataModel::List()); + err = encoder.EncodeList([](const TagBoundEncoder & aEncoder) -> CHIP_ERROR { + // TODO activeNetworkFaultsList isn't tracked. Encode the list of 4 entries at 0 none the less + ThreadNetworkDiagnostics::NetworkFault activeNetworkFaultsList[4] = { ThreadNetworkDiagnostics::NetworkFault(0) }; + for (auto fault : activeNetworkFaultsList) + { + ReturnErrorOnFailure(aEncoder.Encode(fault)); + } + + return CHIP_NO_ERROR; + }); } break; diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h index 69b1204259a018..985b115264338c 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h @@ -67,6 +67,7 @@ class GenericThreadStackManagerImpl_OpenThread otInstance * OTInstance() const; static void OnOpenThreadStateChange(uint32_t flags, void * context); + inline void OverrunErrorTally(void); protected: // ===== Methods that implement the ThreadStackManager abstract interface. @@ -132,6 +133,7 @@ class GenericThreadStackManagerImpl_OpenThread // ===== Private members for use by this class only. otInstance * mOTInst; + uint64_t mOverrunCount = 0; #if CHIP_DEVICE_CONFIG_ENABLE_SED ConnectivityManager::SEDPollingConfig mPollingConfig; @@ -258,6 +260,12 @@ inline otInstance * GenericThreadStackManagerImpl_OpenThread::OTInsta return mOTInst; } +template +inline void GenericThreadStackManagerImpl_OpenThread::OverrunErrorTally(void) +{ + mOverrunCount++; +} + template inline void GenericThreadStackManagerImpl_OpenThread::_OnWoBLEAdvertisingStart(void) { diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread_LwIP.cpp b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread_LwIP.cpp index bbd527b79df6cb..cb9c425776f769 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread_LwIP.cpp +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread_LwIP.cpp @@ -353,6 +353,11 @@ err_t GenericThreadStackManagerImpl_OpenThread_LwIP::SendPacket(struc otMessageFree(pktMsg); } + if (lwipErr == ERR_MEM) + { + ThreadStackMgrImpl().OverrunErrorTally(); + } + // Unlock the OpenThread stack. ThreadStackMgrImpl().UnlockThreadStack(); diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index ece4c1dfba5280..646c53780b80dc 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -1330,7 +1330,7 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ + { 0x0000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ { 0x0002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(331) }, /* NetworkName */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ @@ -2040,7 +2040,7 @@ 0x0034, ZAP_ATTRIBUTE_INDEX(47), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(53), 64, 242, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(53), 64, 243, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { \ 0x0036, ZAP_ATTRIBUTE_INDEX(117), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ @@ -2255,7 +2255,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 18, 1918 }, { ZAP_CLUSTER_INDEX(18), 44, 6430 }, { ZAP_CLUSTER_INDEX(62), 3, 18 }, \ + { ZAP_CLUSTER_INDEX(0), 18, 1919 }, { ZAP_CLUSTER_INDEX(18), 44, 6430 }, { ZAP_CLUSTER_INDEX(62), 3, 18 }, \ } // Largest attribute size is needed for various buffers @@ -2265,7 +2265,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (1333) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (8366) +#define ATTRIBUTE_MAX_SIZE (8367) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (3) diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index f78db0ebadca13..2516a6cbcecd8e 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -5815,29 +5815,29 @@ namespace Attributes { namespace Channel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + NumericAttributeTraits::StorageType temp; + uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_INVALID_VALUE; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = NumericAttributeTraits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_INVALID_ARGUMENT; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + NumericAttributeTraits::StorageType storageValue; + NumericAttributeTraits::WorkingToStorage(value, storageValue); + uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Channel diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index e0de3908aa65ed..a430425acf484d 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -1133,8 +1133,8 @@ namespace ThreadNetworkDiagnostics { namespace Attributes { namespace Channel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Channel namespace RoutingRole { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 91103e4dcf1fce..8bc9014e7dbccd 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -10126,9 +10126,9 @@ namespace Attributes { namespace Channel { struct TypeInfo { - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; + using Type = uint16_t; + using DecodableType = uint16_t; + using DecodableArgType = uint16_t; static constexpr ClusterId GetClusterId() { return Clusters::ThreadNetworkDiagnostics::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::Channel::Id; } diff --git a/zzz_generated/bridge-app/zap-generated/endpoint_config.h b/zzz_generated/bridge-app/zap-generated/endpoint_config.h index 32961bb84c5060..e508a81491d907 100644 --- a/zzz_generated/bridge-app/zap-generated/endpoint_config.h +++ b/zzz_generated/bridge-app/zap-generated/endpoint_config.h @@ -639,7 +639,7 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ + { 0x0000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ { 0x0002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(314) }, /* NetworkName */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ @@ -832,7 +832,7 @@ 0x0034, ZAP_ATTRIBUTE_INDEX(32), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(38), 64, 242, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(38), 64, 243, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { \ 0x0036, ZAP_ATTRIBUTE_INDEX(102), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ @@ -874,7 +874,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 12, 930 }, { ZAP_CLUSTER_INDEX(12), 5, 291 }, \ + { ZAP_CLUSTER_INDEX(0), 12, 931 }, { ZAP_CLUSTER_INDEX(12), 5, 291 }, \ } // Largest attribute size is needed for various buffers @@ -884,7 +884,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (246) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (1221) +#define ATTRIBUTE_MAX_SIZE (1222) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (2) diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index da75e38bf0d8e0..3915cf2a4a8d0c 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -44227,8 +44227,8 @@ class ReadThreadNetworkDiagnosticsChannel : public ModelCommand } private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnInt8uAttributeResponse, this); + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); }; @@ -44278,8 +44278,8 @@ class ReportThreadNetworkDiagnosticsChannel : public ModelCommand new chip::Callback::Callback(OnDefaultSuccessResponseWithoutExit, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::Callback::Callback * onReportCallback = - new chip::Callback::Callback(OnInt8uAttributeReport, this); + chip::Callback::Callback * onReportCallback = + new chip::Callback::Callback(OnInt16uAttributeReport, this); uint16_t mMinInterval; uint16_t mMaxInterval; bool mWait; diff --git a/zzz_generated/chip-tool/zap-generated/reporting/Commands.h b/zzz_generated/chip-tool/zap-generated/reporting/Commands.h index c68ac27e94b91e..3f596275c4cc36 100644 --- a/zzz_generated/chip-tool/zap-generated/reporting/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/reporting/Commands.h @@ -1386,7 +1386,7 @@ class Listen : public ReportingCommand BasicAttributeFilter); callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0000, onReportThreadNetworkDiagnosticsChannelCallback->Cancel(), - BasicAttributeFilter); + BasicAttributeFilter); callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0001, onReportThreadNetworkDiagnosticsRoutingRoleCallback->Cancel(), BasicAttributeFilter); @@ -2413,8 +2413,8 @@ class Listen : public ReportingCommand new chip::Callback::Callback(OnInt8uAttributeResponse, this); chip::Callback::Callback * onReportThermostatUserInterfaceConfigurationClusterRevisionCallback = new chip::Callback::Callback(OnInt16uAttributeResponse, this); - chip::Callback::Callback * onReportThreadNetworkDiagnosticsChannelCallback = - new chip::Callback::Callback(OnInt8uAttributeResponse, this); + chip::Callback::Callback * onReportThreadNetworkDiagnosticsChannelCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); chip::Callback::Callback * onReportThreadNetworkDiagnosticsRoutingRoleCallback = new chip::Callback::Callback(OnInt8uAttributeResponse, this); chip::Callback::Callback * onReportThreadNetworkDiagnosticsNetworkNameCallback = diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp index 927143cdd24fe7..50082b2285f1d4 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp @@ -18819,7 +18819,7 @@ CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReadAttributeChannel(Callback::Cance attributePath.mClusterId = mClusterId; attributePath.mAttributeId = 0x00000000; return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, - BasicAttributeFilter); + BasicAttributeFilter); } CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeChannel(Callback::Cancelable * onSuccessCallback, @@ -18836,7 +18836,7 @@ CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeChannel(Callback:: CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeChannel(Callback::Cancelable * onReportCallback) { return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::Channel::Id, onReportCallback, - BasicAttributeFilter); + BasicAttributeFilter); } CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReadAttributeRoutingRole(Callback::Cancelable * onSuccessCallback, diff --git a/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.cpp b/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.cpp index 4ec2c61992380b..727069746b1a15 100644 --- a/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.cpp +++ b/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.cpp @@ -2873,7 +2873,7 @@ CHIP_ERROR ThermostatUserInterfaceConfigurationClusterTest::WriteAttributeCluste } CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeChannel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) + Callback::Cancelable * onFailureCallback, uint16_t value) { app::WriteClientHandle handle; ReturnErrorOnFailure( diff --git a/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.h b/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.h index e677a29af43e8f..bb6096ca8f7124 100644 --- a/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.h +++ b/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.h @@ -997,7 +997,7 @@ class DLL_EXPORT ThreadNetworkDiagnosticsClusterTest : public ThreadNetworkDiagn ~ThreadNetworkDiagnosticsClusterTest() {} CHIP_ERROR WriteAttributeChannel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t value); + uint16_t value); CHIP_ERROR WriteAttributeRoutingRole(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t value); CHIP_ERROR WriteAttributeNetworkName(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, diff --git a/zzz_generated/lighting-app/zap-generated/endpoint_config.h b/zzz_generated/lighting-app/zap-generated/endpoint_config.h index 1229de02721f23..dbb525890ac48f 100644 --- a/zzz_generated/lighting-app/zap-generated/endpoint_config.h +++ b/zzz_generated/lighting-app/zap-generated/endpoint_config.h @@ -611,7 +611,7 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ + { 0x0000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ { 0x0002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(314) }, /* NetworkName */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ @@ -855,7 +855,7 @@ 0x0034, ZAP_ATTRIBUTE_INDEX(40), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(46), 64, 242, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(46), 64, 243, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { \ 0x0036, ZAP_ATTRIBUTE_INDEX(110), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ @@ -915,7 +915,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 13, 1371 }, { ZAP_CLUSTER_INDEX(13), 6, 82 }, { ZAP_CLUSTER_INDEX(19), 2, 6 }, \ + { ZAP_CLUSTER_INDEX(0), 13, 1372 }, { ZAP_CLUSTER_INDEX(13), 6, 82 }, { ZAP_CLUSTER_INDEX(19), 2, 6 }, \ } // Largest attribute size is needed for various buffers @@ -925,7 +925,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (687) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (1459) +#define ATTRIBUTE_MAX_SIZE (1460) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (3) diff --git a/zzz_generated/lock-app/zap-generated/endpoint_config.h b/zzz_generated/lock-app/zap-generated/endpoint_config.h index 7774bfb3ac219c..87a9f0a262ad2c 100644 --- a/zzz_generated/lock-app/zap-generated/endpoint_config.h +++ b/zzz_generated/lock-app/zap-generated/endpoint_config.h @@ -602,7 +602,7 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ + { 0x0000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ { 0x0002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(314) }, /* NetworkName */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ @@ -768,7 +768,7 @@ 0x0034, ZAP_ATTRIBUTE_INDEX(32), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(38), 64, 242, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(38), 64, 243, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { \ 0x0036, ZAP_ATTRIBUTE_INDEX(102), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ @@ -798,7 +798,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 12, 930 }, { ZAP_CLUSTER_INDEX(12), 2, 13 }, \ + { ZAP_CLUSTER_INDEX(0), 12, 931 }, { ZAP_CLUSTER_INDEX(12), 2, 13 }, \ } // Largest attribute size is needed for various buffers @@ -808,7 +808,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (246) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (943) +#define ATTRIBUTE_MAX_SIZE (944) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (2) diff --git a/zzz_generated/pump-app/zap-generated/endpoint_config.h b/zzz_generated/pump-app/zap-generated/endpoint_config.h index eac4672739fc82..4fe5f355c91b23 100644 --- a/zzz_generated/pump-app/zap-generated/endpoint_config.h +++ b/zzz_generated/pump-app/zap-generated/endpoint_config.h @@ -620,7 +620,7 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ + { 0x0000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ { 0x0002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(314) }, /* NetworkName */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ @@ -848,7 +848,7 @@ 0x0034, ZAP_ATTRIBUTE_INDEX(32), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(38), 64, 242, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(38), 64, 243, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { \ 0x0036, ZAP_ATTRIBUTE_INDEX(102), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ @@ -910,7 +910,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 12, 930 }, { ZAP_CLUSTER_INDEX(12), 10, 90 }, \ + { ZAP_CLUSTER_INDEX(0), 12, 931 }, { ZAP_CLUSTER_INDEX(12), 10, 90 }, \ } // Largest attribute size is needed for various buffers @@ -920,7 +920,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (246) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (1020) +#define ATTRIBUTE_MAX_SIZE (1021) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (2) diff --git a/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h b/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h index e4b5db20da631c..7243731f95b495 100644 --- a/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h +++ b/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h @@ -595,7 +595,7 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ + { 0x0000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ { 0x0002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(314) }, /* NetworkName */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ @@ -769,7 +769,7 @@ 0x0034, ZAP_ATTRIBUTE_INDEX(33), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(39), 64, 242, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(39), 64, 243, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { \ 0x0036, ZAP_ATTRIBUTE_INDEX(103), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ @@ -808,7 +808,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 13, 932 }, { ZAP_CLUSTER_INDEX(13), 6, 10 }, \ + { ZAP_CLUSTER_INDEX(0), 13, 933 }, { ZAP_CLUSTER_INDEX(13), 6, 10 }, \ } // Largest attribute size is needed for various buffers @@ -818,7 +818,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (246) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (942) +#define ATTRIBUTE_MAX_SIZE (943) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (2) diff --git a/zzz_generated/thermostat/zap-generated/endpoint_config.h b/zzz_generated/thermostat/zap-generated/endpoint_config.h index eeda93666978cf..23c3f6cd7fa1e2 100644 --- a/zzz_generated/thermostat/zap-generated/endpoint_config.h +++ b/zzz_generated/thermostat/zap-generated/endpoint_config.h @@ -704,7 +704,7 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ + { 0x0000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ { 0x0002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(331) }, /* NetworkName */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ @@ -940,7 +940,7 @@ 0x0034, ZAP_ATTRIBUTE_INDEX(43), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(49), 64, 242, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(49), 64, 243, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { \ 0x0036, ZAP_ATTRIBUTE_INDEX(113), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ @@ -997,7 +997,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 16, 1889 }, { ZAP_CLUSTER_INDEX(16), 6, 298 }, \ + { ZAP_CLUSTER_INDEX(0), 16, 1890 }, { ZAP_CLUSTER_INDEX(16), 6, 298 }, \ } // Largest attribute size is needed for various buffers @@ -1007,7 +1007,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (933) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (2187) +#define ATTRIBUTE_MAX_SIZE (2188) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (2) diff --git a/zzz_generated/tv-app/zap-generated/endpoint_config.h b/zzz_generated/tv-app/zap-generated/endpoint_config.h index 4e8319639f6098..c873086e9b26e2 100644 --- a/zzz_generated/tv-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-app/zap-generated/endpoint_config.h @@ -1108,7 +1108,7 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ + { 0x0000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ { 0x0002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(314) }, /* NetworkName */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ @@ -1443,7 +1443,7 @@ 0x0034, ZAP_ATTRIBUTE_INDEX(42), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(48), 64, 242, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(48), 64, 243, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { \ 0x0036, ZAP_ATTRIBUTE_INDEX(112), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ @@ -1557,7 +1557,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 19, 1898 }, { ZAP_CLUSTER_INDEX(19), 10, 1645 }, { ZAP_CLUSTER_INDEX(29), 4, 283 }, \ + { ZAP_CLUSTER_INDEX(0), 19, 1899 }, { ZAP_CLUSTER_INDEX(19), 10, 1645 }, { ZAP_CLUSTER_INDEX(29), 4, 283 }, \ { ZAP_CLUSTER_INDEX(33), 5, 679 }, { ZAP_CLUSTER_INDEX(38), 3, 618 }, { ZAP_CLUSTER_INDEX(41), 2, 108 }, \ } @@ -1568,7 +1568,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (686) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (5231) +#define ATTRIBUTE_MAX_SIZE (5232) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (6) diff --git a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h index c6af5bd5dcc979..8094d61eef64e7 100644 --- a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h @@ -1114,7 +1114,7 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ + { 0x0000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ { 0x0002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(331) }, /* NetworkName */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ @@ -1622,7 +1622,7 @@ 0x0034, ZAP_ATTRIBUTE_INDEX(41), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(47), 64, 242, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(47), 64, 243, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { \ 0x0036, ZAP_ATTRIBUTE_INDEX(111), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ @@ -1791,7 +1791,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 16, 1893 }, { ZAP_CLUSTER_INDEX(16), 33, 4996 }, { ZAP_CLUSTER_INDEX(49), 3, 8 }, \ + { ZAP_CLUSTER_INDEX(0), 16, 1894 }, { ZAP_CLUSTER_INDEX(16), 33, 4996 }, { ZAP_CLUSTER_INDEX(49), 3, 8 }, \ } // Largest attribute size is needed for various buffers @@ -1801,7 +1801,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (1333) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (6897) +#define ATTRIBUTE_MAX_SIZE (6898) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (3) diff --git a/zzz_generated/window-app/zap-generated/endpoint_config.h b/zzz_generated/window-app/zap-generated/endpoint_config.h index 3b5f914040c0c9..d94b755677c92f 100644 --- a/zzz_generated/window-app/zap-generated/endpoint_config.h +++ b/zzz_generated/window-app/zap-generated/endpoint_config.h @@ -612,7 +612,7 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ + { 0x0000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ { 0x0002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(314) }, /* NetworkName */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ @@ -823,7 +823,7 @@ 0x0034, ZAP_ATTRIBUTE_INDEX(32), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(38), 64, 242, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(38), 64, 243, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { \ 0x0036, ZAP_ATTRIBUTE_INDEX(102), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ @@ -862,7 +862,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 11, 930 }, { ZAP_CLUSTER_INDEX(11), 3, 40 }, { ZAP_CLUSTER_INDEX(14), 2, 35 }, \ + { ZAP_CLUSTER_INDEX(0), 11, 931 }, { ZAP_CLUSTER_INDEX(11), 3, 40 }, { ZAP_CLUSTER_INDEX(14), 2, 35 }, \ } // Largest attribute size is needed for various buffers @@ -872,7 +872,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (246) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (1005) +#define ATTRIBUTE_MAX_SIZE (1006) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (3)