From cf41a9063e45512e17ccbad0e2437275d0999662 Mon Sep 17 00:00:00 2001 From: Ricardo Casallas Date: Thu, 27 Jan 2022 05:47:08 -0500 Subject: [PATCH] Group Key Management cluster XML: YAML tests enabled. --- .../group-key-mgmt-server.cpp | 16 +- .../suites/TestGroupKeyManagementCluster.yaml | 230 +- .../chip/group-key-mgmt-cluster.xml | 2 +- .../data_model/controller-clusters.matter | 18 +- .../java/zap-generated/CHIPClusters-JNI.cpp | 415 +- .../zap-generated/CHIPInvokeCallbacks.cpp | 131 +- .../java/zap-generated/CHIPReadCallbacks.cpp | 258 +- .../java/zap-generated/CHIPReadCallbacks.h | 24 +- .../chip/devicecontroller/ChipClusters.java | 129 +- .../chip/devicecontroller/ChipStructs.java | 61 +- .../devicecontroller/ClusterInfoMapping.java | 84 +- .../python/chip/clusters/CHIPClusters.py | 6 + .../tests/TestGroupDataProvider.cpp | 25 +- .../CHIP/zap-generated/CHIPCallbackBridge.mm | 72 +- .../CHIPCallbackBridge_internal.h | 22 +- .../CHIP/zap-generated/CHIPClustersObjc.h | 29 + .../CHIP/zap-generated/CHIPClustersObjc.mm | 120 +- .../zap-generated/CHIPTestClustersObjc.mm | 86 +- .../Framework/CHIPTests/CHIPClustersTests.m | 440 + .../zap-generated/endpoint_config.h | 2108 +- .../zap-generated/cluster-objects.h | 14 +- .../zap-generated/endpoint_config.h | 811 +- .../zap-generated/cluster/Commands.h | 52700 +--------------- .../cluster/ComplexArgumentParser.cpp | 58 +- .../cluster/ComplexArgumentParser.h | 12 +- .../cluster/logging/DataModelLogger.cpp | 33 +- .../cluster/logging/DataModelLogger.h | 6 +- .../chip-tool/zap-generated/test/Commands.h | 616 +- .../zap-generated/CHIPClientCallbacks.h | 100 +- .../zap-generated/CHIPClusters.h | 12 - .../zap-generated/IMClusterCommandHandler.cpp | 3904 -- .../zap-generated/endpoint_config.h | 2 +- .../zap-generated/endpoint_config.h | 30 +- .../zap-generated/endpoint_config.h | 487 +- .../lock-app/zap-generated/endpoint_config.h | 30 +- .../zap-generated/endpoint_config.h | 7 +- .../zap-generated/endpoint_config.h | 9 +- .../app1/zap-generated/endpoint_config.h | 11 +- .../app2/zap-generated/endpoint_config.h | 11 +- .../pump-app/zap-generated/endpoint_config.h | 768 +- .../zap-generated/endpoint_config.h | 843 +- .../zap-generated/endpoint_config.h | 461 +- .../zap-generated/endpoint_config.h | 939 +- .../tv-app/zap-generated/endpoint_config.h | 1356 +- .../zap-generated/endpoint_config.h | 1453 +- .../zap-generated/endpoint_config.h | 41 +- 46 files changed, 8599 insertions(+), 60391 deletions(-) diff --git a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp index 93d41fed2e47e5..f3d1406741e68e 100644 --- a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp +++ b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp @@ -284,10 +284,10 @@ bool emberAfGroupKeyManagementClusterKeySetWriteCallback( keyset.num_keys_used++; // Epoch Key 1 - if (!commandData.groupKeySet.epochKey1.IsNull() && !commandData.groupKeySet.epochStartTime1.IsNull() && - !commandData.groupKeySet.epochKey1.Value().empty()) + if (!commandData.groupKeySet.epochKey1.IsNull()) { - if (commandData.groupKeySet.epochStartTime1.Value() <= commandData.groupKeySet.epochStartTime0.Value()) + if (commandData.groupKeySet.epochStartTime1.IsNull() || + commandData.groupKeySet.epochStartTime1.Value() <= commandData.groupKeySet.epochStartTime0.Value()) { // If the EpochKey1 field is not null, its associated EpochStartTime1 field SHALL contain // a later epoch start time than the epoch start time found in the EpochStartTime0 field. @@ -301,11 +301,10 @@ bool emberAfGroupKeyManagementClusterKeySetWriteCallback( } // Epoch Key 2 - if (!commandData.groupKeySet.epochKey2.IsNull() && !commandData.groupKeySet.epochStartTime2.IsNull() && - !commandData.groupKeySet.epochKey2.Value().empty()) + if (!commandData.groupKeySet.epochKey2.IsNull()) { - keyset.num_keys_used++; - if (commandData.groupKeySet.epochStartTime2.Value() <= commandData.groupKeySet.epochStartTime1.Value()) + if (commandData.groupKeySet.epochKey1.IsNull() || commandData.groupKeySet.epochStartTime2.IsNull() || + commandData.groupKeySet.epochStartTime2.Value() <= commandData.groupKeySet.epochStartTime1.Value()) { // If the EpochKey2 field is not null then: // * The EpochKey1 field SHALL NOT be null @@ -362,8 +361,7 @@ bool emberAfGroupKeyManagementClusterKeySetReadCallback( return true; } - // In KeySetReadResponse EpochKey0, EpochKey1 and EpochKey2 fields shall be null. - + // In KeySetReadResponse, EpochKey0, EpochKey1 and EpochKey2 key contents shall be null GroupKeyManagement::Commands::KeySetReadResponse::Type response; response.groupKeySet.groupKeySetID = keyset.keyset_id; response.groupKeySet.groupKeySecurityPolicy = keyset.policy; diff --git a/src/app/tests/suites/TestGroupKeyManagementCluster.yaml b/src/app/tests/suites/TestGroupKeyManagementCluster.yaml index c58b022bae6699..d3bde48b3231c2 100644 --- a/src/app/tests/suites/TestGroupKeyManagementCluster.yaml +++ b/src/app/tests/suites/TestGroupKeyManagementCluster.yaml @@ -37,146 +37,196 @@ tests: value: 2 - label: "Add Group 1" - disabled: true cluster: "Groups" endpoint: 1 command: "AddGroup" arguments: values: - - name: "groupId" - value: 11 - - name: "groupName" + - name: "GroupId" + value: 0x0011 + - name: "GroupName" value: "Group #1" response: values: - name: "status" value: 0 - - name: "groupId" - value: 11 + - name: "GroupId" + value: 0x0011 - label: "Add Group 2" - disabled: true cluster: "Groups" endpoint: 1 command: "AddGroup" arguments: values: - - name: "groupId" - value: 12 - - name: "groupName" + - name: "GroupId" + value: 0x0012 + - name: "GroupName" value: "Group #2" response: values: - name: "status" value: 0 - - name: "groupId" - value: 12 + - name: "GroupId" + value: 0x0012 - - label: "KeySetWrite 1" - disabled: true + - label: "KeySet Write 1" command: "KeySetWrite" arguments: values: - - name: "groupKeySet" + - name: "GroupKeySet" value: { - groupKeySetID: 101, - securityPolicy: 0, - epochKey0: - [ - 0xa0, - 0xa1, - 0xa2, - 0xa3, - 0xa4, - 0xa5, - 0xa6, - 0xa7, - 0xa8, - 0xa9, - 0xaa, - 0xab, - 0xac, - 0xad, - 0xae, - 0xaf, - ], - epochStartTime0: 1110000, - epochKey1: - [ - 0xb0, - 0xb1, - 0xb2, - 0xb3, - 0xb4, - 0xb5, - 0xb6, - 0xb7, - 0xb8, - 0xb9, - 0xba, - 0xbb, - 0xbc, - 0xbd, - 0xbe, - 0xbf, - ], - epochStartTime1: 1110001, - epochKey2: - [ - 0xc0, - 0xc1, - 0xc2, - 0xc3, - 0xc4, - 0xc5, - 0xc6, - 0xc7, - 0xc8, - 0xc9, - 0xca, - 0xcb, - 0xcc, - 0xcd, - 0xce, - 0xcf, - ], - epochStartTime2: 1110002, + GroupKeySetID: 0x0101, + GroupKeySecurityPolicy: 0, + EpochKey0: "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf", + EpochStartTime0: 1110000, + EpochKey1: "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf", + EpochStartTime1: 1110001, + EpochKey2: "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + EpochStartTime2: 1110002, } - - label: "Write Group Keys" + - label: "KeySet Write 2" + command: "KeySetWrite" + arguments: + values: + - name: "GroupKeySet" + value: + { + GroupKeySetID: 0x0102, + GroupKeySecurityPolicy: 1, + EpochKey0: "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf", + EpochStartTime0: 2110000, + EpochKey1: "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef", + EpochStartTime1: 2110001, + EpochKey2: "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff", + EpochStartTime2: 2110002, + } + + - label: "KeySet Read" + command: "KeySetRead" + arguments: + values: + - name: "GroupKeySetID" + value: 0x0101 + response: + values: + - name: "GroupKeySet" + value: + { + GroupKeySetID: 0x0101, + GroupKeySecurityPolicy: 0, + EpochKey0: null, + EpochStartTime0: 1110000, + EpochKey1: null, + EpochStartTime1: 1110001, + EpochKey2: null, + EpochStartTime2: 1110002, + } + + - label: "KeySet Read All Indicers" disabled: true + command: "KeySetReadAllIndices" + response: + values: + - name: "GroupKeySetIDs" + value: [0x0101, 0x0102] + + - label: "Write Group Keys" command: "writeAttribute" - attribute: "groupKeyMap" + attribute: "GroupKeyMap" arguments: value: [ - { fabricIndex: 1, groupId: 11, groupKeySetID: 101 }, - { fabricIndex: 1, groupId: 12, groupKeySetID: 102 }, + { FabricIndex: 1, GroupId: 0x0011, GroupKeySetID: 0x0101 }, + { FabricIndex: 1, GroupId: 0x0012, GroupKeySetID: 0x0102 }, ] - label: "Read Group Keys" - disabled: true command: "readAttribute" - attribute: "groupKeyMap" + attribute: "GroupKeyMap" response: value: [ - { fabricIndex: 1, groupId: 11, groupKeySetID: 101 }, - { fabricIndex: 1, groupId: 12, groupKeySetID: 102 }, + { FabricIndex: 1, GroupId: 0x0011, GroupKeySetID: 0x0101 }, + { FabricIndex: 1, GroupId: 0x0012, GroupKeySetID: 0x0102 }, ] - label: "Read GroupTable" - disabled: true command: "readAttribute" - attribute: "groupTable" + attribute: "GroupTable" response: value: [ { - fabricIndex: 1, - groupId: 11, + FabricIndex: 1, + GroupId: 0x0011, endpoints: [1], - groupName: "Group #1", + GroupName: "Group #1", + }, + { + FabricIndex: 1, + GroupId: 0x0012, + endpoints: [1], + GroupName: "Group #2", }, ] + + - label: "KeySet Remove 1" + command: "KeySetRemove" + arguments: + values: + - name: "GroupKeySetID" + value: 0x0101 + + - label: "KeySet Read (removed)" + command: "KeySetRead" + arguments: + values: + - name: "GroupKeySetID" + value: 0x0101 + response: + error: NOT_FOUND + + - label: "KeySet Read (not removed)" + command: "KeySetRead" + arguments: + values: + - name: "GroupKeySetID" + value: 0x0102 + response: + values: + - name: "GroupKeySet" + value: + { + GroupKeySetID: 0x0102, + GroupKeySecurityPolicy: 1, + EpochKey0: null, + EpochStartTime0: 2110000, + EpochKey1: null, + EpochStartTime1: 2110001, + EpochKey2: null, + EpochStartTime2: 2110002, + } + + - label: "Remove All" + cluster: "Groups" + endpoint: 1 + command: "RemoveAllGroups" + + - label: "KeySet Remove 2" + command: "KeySetRemove" + arguments: + values: + - name: "GroupKeySetID" + value: 0x0102 + + - label: "KeySet Read (also removed)" + command: "KeySetRead" + arguments: + values: + - name: "GroupKeySetID" + value: 0x0102 + response: + error: NOT_FOUND diff --git a/src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml index 6209c64e3bc66f..361df96c523592 100644 --- a/src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml @@ -84,7 +84,7 @@ limitations under the License. - Revoke a Root Key from a Group + Return the list of Group Key Sets associated with the accessing fabric diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 9627f62b485266..d01ddc9f6f8245 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -1842,6 +1842,8 @@ client cluster GroupKeyManagement = 63 { readonly attribute GroupInfoMapStruct groupTable[] = 1; readonly attribute int16u maxGroupsPerFabric = 2; readonly attribute int16u maxGroupKeysPerFabric = 3; + readonly global attribute command_id serverGeneratedCommandList[] = 65528; + readonly global attribute command_id clientGeneratedCommandList[] = 65529; readonly global attribute attrib_id attributeList[] = 65531; readonly global attribute int16u clusterRevision = 65533; @@ -2209,7 +2211,9 @@ client cluster LevelControl = 8 { client cluster LocalizationConfiguration = 43 { attribute char_string<35> activeLocale = 1; readonly attribute CHAR_STRING supportedLocales[] = 2; - readonly global nosubscribe attribute int16u clusterRevision = 65533; + readonly global attribute command_id serverGeneratedCommandList[] = 65528; + readonly global attribute command_id clientGeneratedCommandList[] = 65529; + readonly global attribute int16u clusterRevision = 65533; } client cluster LowPower = 1288 { @@ -2712,7 +2716,7 @@ client cluster OperationalCredentials = 62 { CHAR_STRING<32> label = 5; } - readonly nosubscribe attribute NOCStruct NOCs[] = 0; + readonly attribute NOCStruct NOCs[] = 0; readonly attribute FabricDescriptor fabricsList[] = 1; readonly attribute int8u supportedFabrics = 2; readonly attribute int8u commissionedFabrics = 3; @@ -3781,10 +3785,12 @@ client cluster TimeFormatLocalization = 44 { k24hr = 1; } - nosubscribe attribute HourFormat hourFormat = 0; - nosubscribe attribute CalendarType activeCalendarType = 1; - readonly nosubscribe attribute CalendarType supportedCalendarTypes[] = 2; - readonly global nosubscribe attribute int16u clusterRevision = 65533; + attribute HourFormat hourFormat = 0; + attribute CalendarType activeCalendarType = 1; + readonly attribute CalendarType supportedCalendarTypes[] = 2; + readonly global attribute command_id serverGeneratedCommandList[] = 65528; + readonly global attribute command_id clientGeneratedCommandList[] = 65529; + readonly global attribute int16u clusterRevision = 65533; } client cluster UnitLocalization = 45 { diff --git a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp index d7790788703575..41359b0ae35e90 100644 --- a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp @@ -15224,9 +15224,7 @@ JNI_METHOD(void, GroupKeyManagementCluster, keySetRemove) onFailure.release(); } JNI_METHOD(void, GroupKeyManagementCluster, keySetWrite) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupKeySetID, jobject groupKeySecurityPolicy, - jbyteArray epochKey0, jobject epochStartTime0, jbyteArray epochKey1, jobject epochStartTime1, jbyteArray epochKey2, - jobject epochStartTime2, jobject timedInvokeTimeoutMs) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupKeySet, jobject timedInvokeTimeoutMs) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -15235,7 +15233,97 @@ JNI_METHOD(void, GroupKeyManagementCluster, keySetWrite) ListFreer listFreer; chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type request; - request.groupKeySet = chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::Type(); + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + jobject groupKeySet_groupKeySetIDItem_0; + chip::JniReferences::GetInstance().GetObjectField(groupKeySet, "groupKeySetID", "Ljava/lang/Integer;", + groupKeySet_groupKeySetIDItem_0); + request.groupKeySet.groupKeySetID = static_cast>( + chip::JniReferences::GetInstance().IntegerToPrimitive(groupKeySet_groupKeySetIDItem_0)); + jobject groupKeySet_groupKeySecurityPolicyItem_0; + chip::JniReferences::GetInstance().GetObjectField(groupKeySet, "groupKeySecurityPolicy", "Ljava/lang/Integer;", + groupKeySet_groupKeySecurityPolicyItem_0); + request.groupKeySet.groupKeySecurityPolicy = + static_cast>( + chip::JniReferences::GetInstance().IntegerToPrimitive(groupKeySet_groupKeySecurityPolicyItem_0)); + jobject groupKeySet_epochKey0Item_0; + chip::JniReferences::GetInstance().GetObjectField(groupKeySet, "epochKey0", "[B", groupKeySet_epochKey0Item_0); + if (groupKeySet_epochKey0Item_0 == nullptr) + { + request.groupKeySet.epochKey0.SetNull(); + } + else + { + auto & nonNullValue_1 = request.groupKeySet.epochKey0.SetNonNull(); + cleanupByteArrays.push_back( + chip::Platform::MakeUnique(env, static_cast(groupKeySet_epochKey0Item_0))); + nonNullValue_1 = cleanupByteArrays.back()->byteSpan(); + } + jobject groupKeySet_epochStartTime0Item_0; + chip::JniReferences::GetInstance().GetObjectField(groupKeySet, "epochStartTime0", "Ljava/lang/Long;", + groupKeySet_epochStartTime0Item_0); + if (groupKeySet_epochStartTime0Item_0 == nullptr) + { + request.groupKeySet.epochStartTime0.SetNull(); + } + else + { + auto & nonNullValue_1 = request.groupKeySet.epochStartTime0.SetNonNull(); + nonNullValue_1 = static_cast>( + chip::JniReferences::GetInstance().LongToPrimitive(groupKeySet_epochStartTime0Item_0)); + } + jobject groupKeySet_epochKey1Item_0; + chip::JniReferences::GetInstance().GetObjectField(groupKeySet, "epochKey1", "[B", groupKeySet_epochKey1Item_0); + if (groupKeySet_epochKey1Item_0 == nullptr) + { + request.groupKeySet.epochKey1.SetNull(); + } + else + { + auto & nonNullValue_1 = request.groupKeySet.epochKey1.SetNonNull(); + cleanupByteArrays.push_back( + chip::Platform::MakeUnique(env, static_cast(groupKeySet_epochKey1Item_0))); + nonNullValue_1 = cleanupByteArrays.back()->byteSpan(); + } + jobject groupKeySet_epochStartTime1Item_0; + chip::JniReferences::GetInstance().GetObjectField(groupKeySet, "epochStartTime1", "Ljava/lang/Long;", + groupKeySet_epochStartTime1Item_0); + if (groupKeySet_epochStartTime1Item_0 == nullptr) + { + request.groupKeySet.epochStartTime1.SetNull(); + } + else + { + auto & nonNullValue_1 = request.groupKeySet.epochStartTime1.SetNonNull(); + nonNullValue_1 = static_cast>( + chip::JniReferences::GetInstance().LongToPrimitive(groupKeySet_epochStartTime1Item_0)); + } + jobject groupKeySet_epochKey2Item_0; + chip::JniReferences::GetInstance().GetObjectField(groupKeySet, "epochKey2", "[B", groupKeySet_epochKey2Item_0); + if (groupKeySet_epochKey2Item_0 == nullptr) + { + request.groupKeySet.epochKey2.SetNull(); + } + else + { + auto & nonNullValue_1 = request.groupKeySet.epochKey2.SetNonNull(); + cleanupByteArrays.push_back( + chip::Platform::MakeUnique(env, static_cast(groupKeySet_epochKey2Item_0))); + nonNullValue_1 = cleanupByteArrays.back()->byteSpan(); + } + jobject groupKeySet_epochStartTime2Item_0; + chip::JniReferences::GetInstance().GetObjectField(groupKeySet, "epochStartTime2", "Ljava/lang/Long;", + groupKeySet_epochStartTime2Item_0); + if (groupKeySet_epochStartTime2Item_0 == nullptr) + { + request.groupKeySet.epochStartTime2.SetNull(); + } + else + { + auto & nonNullValue_1 = request.groupKeySet.epochStartTime2.SetNonNull(); + nonNullValue_1 = static_cast>( + chip::JniReferences::GetInstance().LongToPrimitive(groupKeySet_epochStartTime2Item_0)); + } std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -16233,10 +16321,12 @@ JNI_METHOD(void, IdentifyCluster, triggerEffect) ListFreer listFreer; chip::app::Clusters::Identify::Commands::TriggerEffect::Type request; - request.effectIdentifier = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(effectIdentifier)); - request.effectVariant = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(effectVariant)); + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + request.effectIdentifier = static_cast>( + chip::JniReferences::GetInstance().IntegerToPrimitive(effectIdentifier)); + request.effectVariant = static_cast>( + chip::JniReferences::GetInstance().IntegerToPrimitive(effectVariant)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -18288,6 +18378,165 @@ JNI_METHOD(void, LocalizationConfigurationCluster, subscribeActiveLocaleAttribut onSuccess.release(); onFailure.release(); } +JNI_METHOD(void, LocalizationConfigurationCluster, subscribeSupportedLocalesAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + LocalizationConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + using TypeInfo = chip::app::Clusters::LocalizationConfiguration::Attributes::SupportedLocales::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPLocalizationConfigurationSupportedLocalesAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, LocalizationConfigurationCluster, subscribeServerGeneratedCommandListAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + LocalizationConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + using TypeInfo = chip::app::Clusters::LocalizationConfiguration::Attributes::ServerGeneratedCommandList::TypeInfo; + auto successFn = chip::Callback::Callback< + CHIPLocalizationConfigurationClusterServerGeneratedCommandListAttributeCallbackType>::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPLocalizationConfigurationServerGeneratedCommandListAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, LocalizationConfigurationCluster, subscribeClientGeneratedCommandListAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + LocalizationConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + using TypeInfo = chip::app::Clusters::LocalizationConfiguration::Attributes::ClientGeneratedCommandList::TypeInfo; + auto successFn = chip::Callback::Callback< + CHIPLocalizationConfigurationClusterClientGeneratedCommandListAttributeCallbackType>::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPLocalizationConfigurationClientGeneratedCommandListAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, LocalizationConfigurationCluster, subscribeClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + LocalizationConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + using TypeInfo = chip::app::Clusters::LocalizationConfiguration::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} JNI_METHOD(jlong, LowPowerCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; @@ -37054,6 +37303,156 @@ JNI_METHOD(jlong, UnitLocalizationCluster, initWithDevice)(JNIEnv * env, jobject return reinterpret_cast(cppCluster); } +JNI_METHOD(void, UnitLocalizationCluster, subscribeTemperatureUnitAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + UnitLocalizationCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + using TypeInfo = chip::app::Clusters::UnitLocalization::Attributes::TemperatureUnit::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, UnitLocalizationCluster, subscribeAttributeListAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + UnitLocalizationCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + using TypeInfo = chip::app::Clusters::UnitLocalization::Attributes::AttributeList::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPUnitLocalizationAttributeListAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, UnitLocalizationCluster, subscribeFeatureMapAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + UnitLocalizationCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + using TypeInfo = chip::app::Clusters::UnitLocalization::Attributes::FeatureMap::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, UnitLocalizationCluster, subscribeClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + UnitLocalizationCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + using TypeInfo = chip::app::Clusters::UnitLocalization::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} JNI_METHOD(jlong, UserLabelCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index 9ce6e2d177b39d..45887fab0685f7 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -1247,8 +1247,19 @@ void CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback::Callback VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); jobject GroupKeySetIDs; + chip::JniReferences::GetInstance().CreateArrayList(GroupKeySetIDs); - GroupKeySetIDs = nullptr; /* Array - Conversion from this type to Java is not properly implemented yet */ + auto iter_GroupKeySetIDs_0 = dataResponse.groupKeySetIDs.begin(); + while (iter_GroupKeySetIDs_0.Next()) + { + auto & entry_0 = iter_GroupKeySetIDs_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Integer"; + std::string newElement_0CtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToArrayList(GroupKeySetIDs, newElement_0); + } env->CallVoidMethod(javaCallbackRef, javaMethod, GroupKeySetIDs); } @@ -1302,14 +1313,122 @@ void CHIPGroupKeyManagementClusterKeySetReadResponseCallback::CallbackFn( // Java callback is allowed to be null, exit early if this is the case. VerifyOrReturn(javaCallbackRef != nullptr); - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", - "(Lchip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupKeySet;)V", - &javaMethod); + err = JniReferences::GetInstance().FindMethod( + env, javaCallbackRef, "onSuccess", "(Lchip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupKeySetStruct;)V", + &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); jobject GroupKeySet; - - GroupKeySet = nullptr; /* Struct - conversion from this type to Java is not properly implemented yet */ + jobject GroupKeySet_groupKeySetID; + std::string GroupKeySet_groupKeySetIDClassName = "java/lang/Integer"; + std::string GroupKeySet_groupKeySetIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + GroupKeySet_groupKeySetIDClassName.c_str(), GroupKeySet_groupKeySetIDCtorSignature.c_str(), + dataResponse.groupKeySet.groupKeySetID, GroupKeySet_groupKeySetID); + jobject GroupKeySet_groupKeySecurityPolicy; + std::string GroupKeySet_groupKeySecurityPolicyClassName = "java/lang/Integer"; + std::string GroupKeySet_groupKeySecurityPolicyCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + GroupKeySet_groupKeySecurityPolicyClassName.c_str(), GroupKeySet_groupKeySecurityPolicyCtorSignature.c_str(), + static_cast(dataResponse.groupKeySet.groupKeySecurityPolicy), GroupKeySet_groupKeySecurityPolicy); + jobject GroupKeySet_epochKey0; + if (dataResponse.groupKeySet.epochKey0.IsNull()) + { + GroupKeySet_epochKey0 = nullptr; + } + else + { + jbyteArray GroupKeySet_epochKey0ByteArray = + env->NewByteArray(static_cast(dataResponse.groupKeySet.epochKey0.Value().size())); + env->SetByteArrayRegion(GroupKeySet_epochKey0ByteArray, 0, + static_cast(dataResponse.groupKeySet.epochKey0.Value().size()), + reinterpret_cast(dataResponse.groupKeySet.epochKey0.Value().data())); + GroupKeySet_epochKey0 = GroupKeySet_epochKey0ByteArray; + } + jobject GroupKeySet_epochStartTime0; + if (dataResponse.groupKeySet.epochStartTime0.IsNull()) + { + GroupKeySet_epochStartTime0 = nullptr; + } + else + { + std::string GroupKeySet_epochStartTime0ClassName = "java/lang/Long"; + std::string GroupKeySet_epochStartTime0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + GroupKeySet_epochStartTime0ClassName.c_str(), GroupKeySet_epochStartTime0CtorSignature.c_str(), + dataResponse.groupKeySet.epochStartTime0.Value(), GroupKeySet_epochStartTime0); + } + jobject GroupKeySet_epochKey1; + if (dataResponse.groupKeySet.epochKey1.IsNull()) + { + GroupKeySet_epochKey1 = nullptr; + } + else + { + jbyteArray GroupKeySet_epochKey1ByteArray = + env->NewByteArray(static_cast(dataResponse.groupKeySet.epochKey1.Value().size())); + env->SetByteArrayRegion(GroupKeySet_epochKey1ByteArray, 0, + static_cast(dataResponse.groupKeySet.epochKey1.Value().size()), + reinterpret_cast(dataResponse.groupKeySet.epochKey1.Value().data())); + GroupKeySet_epochKey1 = GroupKeySet_epochKey1ByteArray; + } + jobject GroupKeySet_epochStartTime1; + if (dataResponse.groupKeySet.epochStartTime1.IsNull()) + { + GroupKeySet_epochStartTime1 = nullptr; + } + else + { + std::string GroupKeySet_epochStartTime1ClassName = "java/lang/Long"; + std::string GroupKeySet_epochStartTime1CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + GroupKeySet_epochStartTime1ClassName.c_str(), GroupKeySet_epochStartTime1CtorSignature.c_str(), + dataResponse.groupKeySet.epochStartTime1.Value(), GroupKeySet_epochStartTime1); + } + jobject GroupKeySet_epochKey2; + if (dataResponse.groupKeySet.epochKey2.IsNull()) + { + GroupKeySet_epochKey2 = nullptr; + } + else + { + jbyteArray GroupKeySet_epochKey2ByteArray = + env->NewByteArray(static_cast(dataResponse.groupKeySet.epochKey2.Value().size())); + env->SetByteArrayRegion(GroupKeySet_epochKey2ByteArray, 0, + static_cast(dataResponse.groupKeySet.epochKey2.Value().size()), + reinterpret_cast(dataResponse.groupKeySet.epochKey2.Value().data())); + GroupKeySet_epochKey2 = GroupKeySet_epochKey2ByteArray; + } + jobject GroupKeySet_epochStartTime2; + if (dataResponse.groupKeySet.epochStartTime2.IsNull()) + { + GroupKeySet_epochStartTime2 = nullptr; + } + else + { + std::string GroupKeySet_epochStartTime2ClassName = "java/lang/Long"; + std::string GroupKeySet_epochStartTime2CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + GroupKeySet_epochStartTime2ClassName.c_str(), GroupKeySet_epochStartTime2CtorSignature.c_str(), + dataResponse.groupKeySet.epochStartTime2.Value(), GroupKeySet_epochStartTime2); + } + + jclass groupKeySetStructStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupKeySetStruct", groupKeySetStructStructClass); + VerifyOrReturn(err == CHIP_NO_ERROR, + ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupKeySetStruct")); + chip::JniClass structJniClass(groupKeySetStructStructClass); + jmethodID groupKeySetStructStructCtor = + env->GetMethodID(groupKeySetStructStructClass, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;[BLjava/lang/Long;[BLjava/lang/Long;[BLjava/lang/Long;)V"); + VerifyOrReturn(groupKeySetStructStructCtor != nullptr, + ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupKeySetStruct constructor")); + + GroupKeySet = + env->NewObject(groupKeySetStructStructClass, groupKeySetStructStructCtor, GroupKeySet_groupKeySetID, + GroupKeySet_groupKeySecurityPolicy, GroupKeySet_epochKey0, GroupKeySet_epochStartTime0, + GroupKeySet_epochKey1, GroupKeySet_epochStartTime1, GroupKeySet_epochKey2, GroupKeySet_epochStartTime2); env->CallVoidMethod(javaCallbackRef, javaMethod, GroupKeySet); } diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 5cc5e5f9e16215..fe3d20f9cf8e11 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -4262,10 +4262,8 @@ CHIPBridgedDeviceBasicAttributeListAttributeCallback::~CHIPBridgedDeviceBasicAtt env->DeleteGlobalRef(javaCallbackRef); } -void CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CallbackFn( - void * context, - const chip::app::DataModel::DecodableList & - list) +void CHIPBridgedDeviceBasicAttributeListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -4286,72 +4284,19 @@ void CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CallbackFn( err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - jclass attributeClass; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipClusters$GroupKeyManagementCluster$GroupKeyMapAttribute", attributeClass); - VerifyOrReturn( - err == CHIP_NO_ERROR, - ChipLogError(Zcl, - "Could not find class chip/devicecontroller/ChipClusters$GroupKeyManagementCluster$GroupKeyMapAttribute")); - chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = - env->GetMethodID(attributeClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V"); - VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find GroupKeyMapAttribute constructor")); + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); - auto iter = list.begin(); - while (iter.Next()) + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) { - auto & entry = iter.GetValue(); - (void) entry; - bool fabricIndexNull = false; - bool fabricIndexHasValue = true; - - chip::FabricIndex fabricIndexValue = entry.fabricIndex; - - jobject fabricIndex = nullptr; - if (!fabricIndexNull && fabricIndexHasValue) - { - jclass fabricIndexEntryCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", fabricIndexEntryCls); - chip::JniClass fabricIndexJniClass(fabricIndexEntryCls); - jmethodID fabricIndexEntryTypeCtor = env->GetMethodID(fabricIndexEntryCls, "", "(I)V"); - fabricIndex = env->NewObject(fabricIndexEntryCls, fabricIndexEntryTypeCtor, fabricIndexValue); - } - - bool groupIdNull = false; - bool groupIdHasValue = true; - - chip::GroupId groupIdValue = entry.groupId; - - jobject groupId = nullptr; - if (!groupIdNull && groupIdHasValue) - { - jclass groupIdEntryCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", groupIdEntryCls); - chip::JniClass groupIdJniClass(groupIdEntryCls); - jmethodID groupIdEntryTypeCtor = env->GetMethodID(groupIdEntryCls, "", "(I)V"); - groupId = env->NewObject(groupIdEntryCls, groupIdEntryTypeCtor, groupIdValue); - } - - bool groupKeySetIDNull = false; - bool groupKeySetIDHasValue = true; - - uint16_t groupKeySetIDValue = entry.groupKeySetID; - - jobject groupKeySetID = nullptr; - if (!groupKeySetIDNull && groupKeySetIDHasValue) - { - jclass groupKeySetIDEntryCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", groupKeySetIDEntryCls); - chip::JniClass groupKeySetIDJniClass(groupKeySetIDEntryCls); - jmethodID groupKeySetIDEntryTypeCtor = env->GetMethodID(groupKeySetIDEntryCls, "", "(I)V"); - groupKeySetID = env->NewObject(groupKeySetIDEntryCls, groupKeySetIDEntryTypeCtor, groupKeySetIDValue); - } - - jobject attributeObj = env->NewObject(attributeClass, attributeCtor, fabricIndex, groupId, groupKeySetID); - VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create GroupKeyMapAttribute object")); - - env->CallBooleanMethod(arrayListObj, arrayListAddMethod, attributeObj); + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToArrayList(arrayListObj, newElement_0); } env->ExceptionClear(); @@ -4388,8 +4333,7 @@ CHIPChannelChannelListAttributeCallback::~CHIPChannelChannelListAttributeCallbac void CHIPChannelChannelListAttributeCallback::CallbackFn( void * context, - const chip::app::DataModel::DecodableList & - list) + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -4410,76 +4354,49 @@ void CHIPChannelChannelListAttributeCallback::CallbackFn( err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - jclass attributeClass; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipClusters$GroupKeyManagementCluster$GroupTableAttribute", attributeClass); - VerifyOrReturn( - err == CHIP_NO_ERROR, - ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$GroupKeyManagementCluster$GroupTableAttribute")); - chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = - env->GetMethodID(attributeClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;)V"); - VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find GroupTableAttribute constructor")); + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); - auto iter = list.begin(); - while (iter.Next()) + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) { - auto & entry = iter.GetValue(); - (void) entry; - bool fabricIndexNull = false; - bool fabricIndexHasValue = true; - - chip::FabricIndex fabricIndexValue = entry.fabricIndex; - - jobject fabricIndex = nullptr; - if (!fabricIndexNull && fabricIndexHasValue) - { - jclass fabricIndexEntryCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", fabricIndexEntryCls); - chip::JniClass fabricIndexJniClass(fabricIndexEntryCls); - jmethodID fabricIndexEntryTypeCtor = env->GetMethodID(fabricIndexEntryCls, "", "(I)V"); - fabricIndex = env->NewObject(fabricIndexEntryCls, fabricIndexEntryTypeCtor, fabricIndexValue); - } - - bool groupIdNull = false; - bool groupIdHasValue = true; - - chip::GroupId groupIdValue = entry.groupId; - - jobject groupId = nullptr; - if (!groupIdNull && groupIdHasValue) - { - jclass groupIdEntryCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", groupIdEntryCls); - chip::JniClass groupIdJniClass(groupIdEntryCls); - jmethodID groupIdEntryTypeCtor = env->GetMethodID(groupIdEntryCls, "", "(I)V"); - groupId = env->NewObject(groupIdEntryCls, groupIdEntryTypeCtor, groupIdValue); - } - - bool groupNameNull = false; - bool groupNameHasValue = true; - - chip::CharSpan groupNameValue; - groupNameHasValue = entry.groupName.HasValue(); - if (groupNameHasValue) - { - groupNameValue = entry.groupName.Value(); - } - - jstring groupName = nullptr; - chip::UtfString groupNameStr(env, groupNameValue); - if (!groupNameNull && groupNameHasValue) - { - groupName = jstring(groupNameStr.jniValue()); - } - - jobject groupNameOptional = nullptr; - chip::JniReferences::GetInstance().CreateOptional(groupName, groupNameOptional); - - jobject attributeObj = env->NewObject(attributeClass, attributeCtor, fabricIndex, groupId, groupNameOptional); - VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create GroupTableAttribute object")); + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + jobject newElement_0_majorNumber; + std::string newElement_0_majorNumberClassName = "java/lang/Integer"; + std::string newElement_0_majorNumberCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_majorNumberClassName.c_str(), + newElement_0_majorNumberCtorSignature.c_str(), + entry_0.majorNumber, newElement_0_majorNumber); + jobject newElement_0_minorNumber; + std::string newElement_0_minorNumberClassName = "java/lang/Integer"; + std::string newElement_0_minorNumberCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_minorNumberClassName.c_str(), + newElement_0_minorNumberCtorSignature.c_str(), + entry_0.minorNumber, newElement_0_minorNumber); + jobject newElement_0_name; + newElement_0_name = env->NewStringUTF(std::string(entry_0.name.data(), entry_0.name.size()).c_str()); + jobject newElement_0_callSign; + newElement_0_callSign = env->NewStringUTF(std::string(entry_0.callSign.data(), entry_0.callSign.size()).c_str()); + jobject newElement_0_affiliateCallSign; + newElement_0_affiliateCallSign = + env->NewStringUTF(std::string(entry_0.affiliateCallSign.data(), entry_0.affiliateCallSign.size()).c_str()); + + jclass channelInfoStructClass; + err = chip::JniReferences::GetInstance().GetClassRef(env, "chip/devicecontroller/ChipStructs$ChannelClusterChannelInfo", + channelInfoStructClass); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterChannelInfo")); + chip::JniClass structJniClass(channelInfoStructClass); + jmethodID channelInfoStructCtor = + env->GetMethodID(channelInfoStructClass, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); + VerifyOrReturn(channelInfoStructCtor != nullptr, + ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterChannelInfo constructor")); - env->CallBooleanMethod(arrayListObj, arrayListAddMethod, attributeObj); + newElement_0 = + env->NewObject(channelInfoStructClass, channelInfoStructCtor, newElement_0_majorNumber, newElement_0_minorNumber, + newElement_0_name, newElement_0_callSign, newElement_0_affiliateCallSign); + chip::JniReferences::GetInstance().AddToArrayList(arrayListObj, newElement_0); } env->ExceptionClear(); @@ -7985,7 +7902,8 @@ CHIPGroupKeyManagementGroupKeyMapAttributeCallback::~CHIPGroupKeyManagementGroup void CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CallbackFn( void * context, - const chip::app::DataModel::DecodableList & list) + const chip::app::DataModel::DecodableList & + list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -8033,19 +7951,19 @@ void CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CallbackFn( newElement_0_groupKeySetIDCtorSignature.c_str(), entry_0.groupKeySetID, newElement_0_groupKeySetID); - jclass groupKeyStructClass; + jclass groupKeyMapStructStructClass; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupKey", groupKeyStructClass); + env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct", groupKeyMapStructStructClass); VerifyOrReturn(err == CHIP_NO_ERROR, - ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupKey")); - chip::JniClass structJniClass(groupKeyStructClass); - jmethodID groupKeyStructCtor = - env->GetMethodID(groupKeyStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V"); - VerifyOrReturn(groupKeyStructCtor != nullptr, - ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupKey constructor")); - - newElement_0 = env->NewObject(groupKeyStructClass, groupKeyStructCtor, newElement_0_fabricIndex, newElement_0_groupId, - newElement_0_groupKeySetID); + ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct")); + chip::JniClass structJniClass(groupKeyMapStructStructClass); + jmethodID groupKeyMapStructStructCtor = env->GetMethodID(groupKeyMapStructStructClass, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V"); + VerifyOrReturn(groupKeyMapStructStructCtor != nullptr, + ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct constructor")); + + newElement_0 = env->NewObject(groupKeyMapStructStructClass, groupKeyMapStructStructCtor, newElement_0_fabricIndex, + newElement_0_groupId, newElement_0_groupKeySetID); chip::JniReferences::GetInstance().AddToArrayList(arrayListObj, newElement_0); } @@ -8085,7 +8003,8 @@ CHIPGroupKeyManagementGroupTableAttributeCallback::~CHIPGroupKeyManagementGroupT void CHIPGroupKeyManagementGroupTableAttributeCallback::CallbackFn( void * context, - const chip::app::DataModel::DecodableList & list) + const chip::app::DataModel::DecodableList & + list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -8117,9 +8036,9 @@ void CHIPGroupKeyManagementGroupTableAttributeCallback::CallbackFn( jobject newElement_0_fabricIndex; std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; std::string newElement_0_fabricIndexCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), - newElement_0_fabricIndexCtorSignature.c_str(), - entry_0.fabricIndex, newElement_0_fabricIndex); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), + newElement_0_fabricIndexCtorSignature.c_str(), + entry_0.fabricIndex, newElement_0_fabricIndex); jobject newElement_0_groupId; std::string newElement_0_groupIdClassName = "java/lang/Integer"; std::string newElement_0_groupIdCtorSignature = "(I)V"; @@ -8141,21 +8060,30 @@ void CHIPGroupKeyManagementGroupTableAttributeCallback::CallbackFn( chip::JniReferences::GetInstance().AddToArrayList(newElement_0_endpoints, newElement_NaN); } jobject newElement_0_groupName; - newElement_0_groupName = env->NewStringUTF(std::string(entry_0.groupName.data(), entry_0.groupName.size()).c_str()); + if (!entry_0.groupName.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_groupName); + } + else + { + newElement_0_groupName = + env->NewStringUTF(std::string(entry_0.groupName.Value().data(), entry_0.groupName.Value().size()).c_str()); + } - jclass groupInfoStructClass; + jclass groupInfoMapStructStructClass; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupInfo", groupInfoStructClass); + env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct", groupInfoMapStructStructClass); VerifyOrReturn(err == CHIP_NO_ERROR, - ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupInfo")); - chip::JniClass structJniClass(groupInfoStructClass); - jmethodID groupInfoStructCtor = env->GetMethodID( - groupInfoStructClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/lang/String;)V"); - VerifyOrReturn(groupInfoStructCtor != nullptr, - ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupInfo constructor")); - - newElement_0 = env->NewObject(groupInfoStructClass, groupInfoStructCtor, newElement_0_fabricIndex, newElement_0_groupId, - newElement_0_endpoints, newElement_0_groupName); + ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct")); + chip::JniClass structJniClass(groupInfoMapStructStructClass); + jmethodID groupInfoMapStructStructCtor = + env->GetMethodID(groupInfoMapStructStructClass, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/Optional;)V"); + VerifyOrReturn(groupInfoMapStructStructCtor != nullptr, + ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct constructor")); + + newElement_0 = env->NewObject(groupInfoMapStructStructClass, groupInfoMapStructStructCtor, newElement_0_fabricIndex, + newElement_0_groupId, newElement_0_endpoints, newElement_0_groupName); chip::JniReferences::GetInstance().AddToArrayList(arrayListObj, newElement_0); } diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.h b/src/controller/java/zap-generated/CHIPReadCallbacks.h index 491f355cfb016f..b64db9fec5fc1c 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.h +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.h @@ -1858,9 +1858,9 @@ class CHIPChannelChannelListAttributeCallback : public chip::Callback::Callback< } } - static void CallbackFn(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::DecodableType> & list); + static void + CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list); static void OnSubscriptionEstablished(void * context) { CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( @@ -1890,9 +1890,7 @@ class CHIPChannelServerGeneratedCommandListAttributeCallback } } - static void CallbackFn(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::GroupKeyManagement::Structs::GroupInfoMapStruct::DecodableType> & list); + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); static void OnSubscriptionEstablished(void * context) { CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( @@ -3340,10 +3338,9 @@ class CHIPGroupKeyManagementGroupKeyMapAttributeCallback } } - static void CallbackFn( - void * context, - const chip::app::DataModel::DecodableList & - list); + static void CallbackFn(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::DecodableType> & list); static void OnSubscriptionEstablished(void * context) { CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( @@ -3373,10 +3370,9 @@ class CHIPGroupKeyManagementGroupTableAttributeCallback } } - static void CallbackFn( - void * context, - const chip::app::DataModel::DecodableList & - list); + static void CallbackFn(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::GroupKeyManagement::Structs::GroupInfoMapStruct::DecodableType> & list); static void OnSubscriptionEstablished(void * context) { CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index f206085cc0a6b3..abcbfeb8e3168e 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -8290,51 +8290,15 @@ public void keySetRemove( public void keySetWrite( DefaultClusterCallback callback, - Integer groupKeySetID, - Integer groupKeySecurityPolicy, - @Nullable byte[] epochKey0, - @Nullable Long epochStartTime0, - @Nullable byte[] epochKey1, - @Nullable Long epochStartTime1, - @Nullable byte[] epochKey2, - @Nullable Long epochStartTime2) { - keySetWrite( - chipClusterPtr, - callback, - groupKeySetID, - groupKeySecurityPolicy, - epochKey0, - epochStartTime0, - epochKey1, - epochStartTime1, - epochKey2, - epochStartTime2, - null); + ChipStructs.GroupKeyManagementClusterGroupKeySetStruct groupKeySet) { + keySetWrite(chipClusterPtr, callback, groupKeySet, null); } public void keySetWrite( DefaultClusterCallback callback, - Integer groupKeySetID, - Integer groupKeySecurityPolicy, - @Nullable byte[] epochKey0, - @Nullable Long epochStartTime0, - @Nullable byte[] epochKey1, - @Nullable Long epochStartTime1, - @Nullable byte[] epochKey2, - @Nullable Long epochStartTime2, + ChipStructs.GroupKeyManagementClusterGroupKeySetStruct groupKeySet, int timedInvokeTimeoutMs) { - keySetWrite( - chipClusterPtr, - callback, - groupKeySetID, - groupKeySecurityPolicy, - epochKey0, - epochStartTime0, - epochKey1, - epochStartTime1, - epochKey2, - epochStartTime2, - timedInvokeTimeoutMs); + keySetWrite(chipClusterPtr, callback, groupKeySet, timedInvokeTimeoutMs); } private native void keySetRead( @@ -8358,68 +8322,31 @@ private native void keySetRemove( private native void keySetWrite( long chipClusterPtr, DefaultClusterCallback Callback, - Integer groupKeySetID, - Integer groupKeySecurityPolicy, - @Nullable byte[] epochKey0, - @Nullable Long epochStartTime0, - @Nullable byte[] epochKey1, - @Nullable Long epochStartTime1, - @Nullable byte[] epochKey2, - @Nullable Long epochStartTime2, + ChipStructs.GroupKeyManagementClusterGroupKeySetStruct groupKeySet, @Nullable Integer timedInvokeTimeoutMs); public interface KeySetReadAllIndicesResponseCallback { - void onSuccess( // GroupKeySetIDs: /* TYPE WARNING: array array defaults to */ uint8_t * - // Conversion from this type to Java is not properly implemented yet - ); + void onSuccess(ArrayList groupKeySetIDs); void onError(Exception error); } public interface KeySetReadResponseCallback { - void onSuccess( // GroupKeySet: Struct GroupKeySetStruct - // Conversion from this type to Java is not properly implemented yet - ); + void onSuccess(ChipStructs.GroupKeyManagementClusterGroupKeySetStruct groupKeySet); void onError(Exception error); } public interface GroupKeyMapAttributeCallback { - void onSuccess(List valueList); + void onSuccess(List valueList); void onError(Exception ex); default void onSubscriptionEstablished() {} } - public static class GroupTableAttribute { - public Integer fabricIndex; - public Integer groupId; - public Optional groupName; - - public GroupTableAttribute(Integer fabricIndex, Integer groupId, Optional groupName) { - this.fabricIndex = fabricIndex; - this.groupId = groupId; - this.groupName = groupName; - } - - @Override - public String toString() { - StringBuilder output = new StringBuilder(""); - output.append("int fabricIndex: "); - output.append(this.fabricIndex); - output.append("\n"); - - output.append("int groupId: "); - output.append(this.groupId); - output.append("\n"); - - return output.toString(); - } - } - public interface GroupTableAttributeCallback { - void onSuccess(List valueList); + void onSuccess(List valueList); void onError(Exception ex); @@ -8456,13 +8383,13 @@ public void readGroupKeyMapAttribute(GroupKeyMapAttributeCallback callback) { public void writeGroupKeyMapAttribute( DefaultClusterCallback callback, - ArrayList value) { + ArrayList value) { writeGroupKeyMapAttribute(chipClusterPtr, callback, value, null); } public void writeGroupKeyMapAttribute( DefaultClusterCallback callback, - ArrayList value, + ArrayList value, int timedWriteTimeoutMs) { writeGroupKeyMapAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); } @@ -8545,7 +8472,7 @@ private native void readGroupKeyMapAttribute( private native void writeGroupKeyMapAttribute( long chipClusterPtr, DefaultClusterCallback callback, - ArrayList value, + ArrayList value, @Nullable Integer timedWriteTimeoutMs); private native void subscribeGroupKeyMapAttribute( @@ -10212,6 +10139,11 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { readClusterRevisionAttribute(chipClusterPtr, callback); } + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + private native void readActiveLocaleAttribute( long chipClusterPtr, CharStringAttributeCallback callback); @@ -10256,6 +10188,9 @@ private native void subscribeClientGeneratedCommandListAttribute( private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class LowPowerCluster extends BaseChipCluster { @@ -20535,6 +20470,11 @@ public void writeHourFormatAttribute( writeHourFormatAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); } + public void subscribeHourFormatAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeHourFormatAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + public void readActiveCalendarTypeAttribute(IntegerAttributeCallback callback) { readActiveCalendarTypeAttribute(chipClusterPtr, callback); } @@ -20548,6 +20488,11 @@ public void writeActiveCalendarTypeAttribute( writeActiveCalendarTypeAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); } + public void subscribeActiveCalendarTypeAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeActiveCalendarTypeAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + public void readSupportedCalendarTypesAttribute( SupportedCalendarTypesAttributeCallback callback) { readSupportedCalendarTypesAttribute(chipClusterPtr, callback); @@ -20584,6 +20529,11 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { readClusterRevisionAttribute(chipClusterPtr, callback); } + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + private native void readHourFormatAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -20593,6 +20543,9 @@ private native void writeHourFormatAttribute( Integer value, @Nullable Integer timedWriteTimeoutMs); + private native void subscribeHourFormatAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + private native void readActiveCalendarTypeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -20602,6 +20555,9 @@ private native void writeActiveCalendarTypeAttribute( Integer value, @Nullable Integer timedWriteTimeoutMs); + private native void subscribeActiveCalendarTypeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + private native void readSupportedCalendarTypesAttribute( long chipClusterPtr, SupportedCalendarTypesAttributeCallback callback); @@ -20631,6 +20587,9 @@ private native void subscribeClientGeneratedCommandListAttribute( private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class UnitLocalizationCluster extends BaseChipCluster { diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java index 773826072e3aa2..6806d59ebb9054 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java @@ -717,14 +717,17 @@ public String toString() { } } - public static class GroupKeyManagementClusterGroupInfo { + public static class GroupKeyManagementClusterGroupInfoMapStruct { public Integer fabricIndex; public Integer groupId; public ArrayList endpoints; - public String groupName; + public Optional groupName; - public GroupKeyManagementClusterGroupInfo( - Integer fabricIndex, Integer groupId, ArrayList endpoints, String groupName) { + public GroupKeyManagementClusterGroupInfoMapStruct( + Integer fabricIndex, + Integer groupId, + ArrayList endpoints, + Optional groupName) { this.fabricIndex = fabricIndex; this.groupId = groupId; this.endpoints = endpoints; @@ -734,7 +737,7 @@ public GroupKeyManagementClusterGroupInfo( @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("GroupKeyManagementClusterGroupInfo {\n"); + output.append("GroupKeyManagementClusterGroupInfoMapStruct {\n"); output.append("\tfabricIndex: "); output.append(fabricIndex); output.append("\n"); @@ -752,12 +755,12 @@ public String toString() { } } - public static class GroupKeyManagementClusterGroupKey { + public static class GroupKeyManagementClusterGroupKeyMapStruct { public Integer fabricIndex; public Integer groupId; public Integer groupKeySetID; - public GroupKeyManagementClusterGroupKey( + public GroupKeyManagementClusterGroupKeyMapStruct( Integer fabricIndex, Integer groupId, Integer groupKeySetID) { this.fabricIndex = fabricIndex; this.groupId = groupId; @@ -767,7 +770,7 @@ public GroupKeyManagementClusterGroupKey( @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("GroupKeyManagementClusterGroupKey {\n"); + output.append("GroupKeyManagementClusterGroupKeyMapStruct {\n"); output.append("\tfabricIndex: "); output.append(fabricIndex); output.append("\n"); @@ -782,27 +785,27 @@ public String toString() { } } - public static class GroupKeyManagementClusterGroupKeySet { + public static class GroupKeyManagementClusterGroupKeySetStruct { public Integer groupKeySetID; - public Integer securityPolicy; - public byte[] epochKey0; - public Long epochStartTime0; - public byte[] epochKey1; - public Long epochStartTime1; - public byte[] epochKey2; - public Long epochStartTime2; - - public GroupKeyManagementClusterGroupKeySet( + public Integer groupKeySecurityPolicy; + public @Nullable byte[] epochKey0; + public @Nullable Long epochStartTime0; + public @Nullable byte[] epochKey1; + public @Nullable Long epochStartTime1; + public @Nullable byte[] epochKey2; + public @Nullable Long epochStartTime2; + + public GroupKeyManagementClusterGroupKeySetStruct( Integer groupKeySetID, - Integer securityPolicy, - byte[] epochKey0, - Long epochStartTime0, - byte[] epochKey1, - Long epochStartTime1, - byte[] epochKey2, - Long epochStartTime2) { + Integer groupKeySecurityPolicy, + @Nullable byte[] epochKey0, + @Nullable Long epochStartTime0, + @Nullable byte[] epochKey1, + @Nullable Long epochStartTime1, + @Nullable byte[] epochKey2, + @Nullable Long epochStartTime2) { this.groupKeySetID = groupKeySetID; - this.securityPolicy = securityPolicy; + this.groupKeySecurityPolicy = groupKeySecurityPolicy; this.epochKey0 = epochKey0; this.epochStartTime0 = epochStartTime0; this.epochKey1 = epochKey1; @@ -814,12 +817,12 @@ public GroupKeyManagementClusterGroupKeySet( @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("GroupKeyManagementClusterGroupKeySet {\n"); + output.append("GroupKeyManagementClusterGroupKeySetStruct {\n"); output.append("\tgroupKeySetID: "); output.append(groupKeySetID); output.append("\n"); - output.append("\tsecurityPolicy: "); - output.append(securityPolicy); + output.append("\tgroupKeySecurityPolicy: "); + output.append(groupKeySecurityPolicy); output.append("\n"); output.append("\tepochKey0: "); output.append(Arrays.toString(epochKey0)); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index 9c9f9acf5ff591..dab4ce8df6c06b 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -1649,12 +1649,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess( // GroupKeySetIDs: /* TYPE WARNING: array array defaults to */ uint8_t * - // Conversion from this type to Java is not properly implemented yet - ) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - // GroupKeySetIDs: /* TYPE WARNING: array array defaults to */ uint8_t * - // Conversion from this type to Java is not properly implemented yet + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -1675,12 +1673,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess( // GroupKeySet: Struct GroupKeySetStruct - // Conversion from this type to Java is not properly implemented yet - ) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - // GroupKeySet: Struct GroupKeySetStruct - // Conversion from this type to Java is not properly implemented yet + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -2931,9 +2927,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(ArrayList groupKeySetIDs) { + public void onSuccess(ArrayList GroupKeySetIDs) { Map responseValues = new LinkedHashMap<>(); - // groupKeySetIDs: /* TYPE WARNING: array array defaults to */ uint8_t * + // GroupKeySetIDs: /* TYPE WARNING: array array defaults to */ uint8_t * // Conversion from this type to Java is not properly implemented yet callback.onSuccess(responseValues); } @@ -2955,9 +2951,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(ChipStructs.GroupKeyManagementClusterGroupKeySet groupKeySet) { + public void onSuccess(ChipStructs.GroupKeyManagementClusterGroupKeySetStruct GroupKeySet) { Map responseValues = new LinkedHashMap<>(); - // groupKeySet: Struct GroupKeySet + // GroupKeySet: Struct GroupKeySetStruct // Conversion from this type to Java is not properly implemented yet callback.onSuccess(responseValues); } @@ -2979,11 +2975,11 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo commandResponseInfo = new CommandResponseInfo( - "valueList", "List"); + "valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -3005,11 +3001,11 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo commandResponseInfo = new CommandResponseInfo( - "valueList", "List"); + "valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -9691,62 +9687,14 @@ public Map> getCommandMap() { "keySetRemove", groupKeyManagementkeySetRemoveInteractionInfo); Map groupKeyManagementkeySetWriteCommandParams = new LinkedHashMap(); - CommandParameterInfo groupKeyManagementkeySetWritegroupKeySetIDCommandParameterInfo = - new CommandParameterInfo("groupKeySetID", int.class); - groupKeyManagementkeySetWriteCommandParams.put( - "groupKeySetID", groupKeyManagementkeySetWritegroupKeySetIDCommandParameterInfo); - - CommandParameterInfo groupKeyManagementkeySetWritegroupKeySecurityPolicyCommandParameterInfo = - new CommandParameterInfo("groupKeySecurityPolicy", int.class); - groupKeyManagementkeySetWriteCommandParams.put( - "groupKeySecurityPolicy", - groupKeyManagementkeySetWritegroupKeySecurityPolicyCommandParameterInfo); - - CommandParameterInfo groupKeyManagementkeySetWriteepochKey0CommandParameterInfo = - new CommandParameterInfo("epochKey0", byte[].class); - groupKeyManagementkeySetWriteCommandParams.put( - "epochKey0", groupKeyManagementkeySetWriteepochKey0CommandParameterInfo); - - CommandParameterInfo groupKeyManagementkeySetWriteepochStartTime0CommandParameterInfo = - new CommandParameterInfo("epochStartTime0", long.class); - groupKeyManagementkeySetWriteCommandParams.put( - "epochStartTime0", groupKeyManagementkeySetWriteepochStartTime0CommandParameterInfo); - - CommandParameterInfo groupKeyManagementkeySetWriteepochKey1CommandParameterInfo = - new CommandParameterInfo("epochKey1", byte[].class); - groupKeyManagementkeySetWriteCommandParams.put( - "epochKey1", groupKeyManagementkeySetWriteepochKey1CommandParameterInfo); - - CommandParameterInfo groupKeyManagementkeySetWriteepochStartTime1CommandParameterInfo = - new CommandParameterInfo("epochStartTime1", long.class); - groupKeyManagementkeySetWriteCommandParams.put( - "epochStartTime1", groupKeyManagementkeySetWriteepochStartTime1CommandParameterInfo); - - CommandParameterInfo groupKeyManagementkeySetWriteepochKey2CommandParameterInfo = - new CommandParameterInfo("epochKey2", byte[].class); - groupKeyManagementkeySetWriteCommandParams.put( - "epochKey2", groupKeyManagementkeySetWriteepochKey2CommandParameterInfo); - - CommandParameterInfo groupKeyManagementkeySetWriteepochStartTime2CommandParameterInfo = - new CommandParameterInfo("epochStartTime2", long.class); - groupKeyManagementkeySetWriteCommandParams.put( - "epochStartTime2", groupKeyManagementkeySetWriteepochStartTime2CommandParameterInfo); - - // Populate commands InteractionInfo groupKeyManagementkeySetWriteInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GroupKeyManagementCluster) cluster) .keySetWrite( (DefaultClusterCallback) callback, - (Integer) commandArguments.get("groupKeySetID"), - (Integer) commandArguments.get("groupKeySecurityPolicy"), - (byte[]) commandArguments.get("epochKey0"), - (Long) commandArguments.get("epochStartTime0"), - (byte[]) commandArguments.get("epochKey1"), - (Long) commandArguments.get("epochStartTime1"), - (byte[]) commandArguments.get("epochKey2"), - (Long) commandArguments.get("epochStartTime2")); + (ChipStructs.GroupKeyManagementClusterGroupKeySetStruct) + commandArguments.get("groupKeySet")); }, () -> new DelegatedDefaultClusterCallback(), groupKeyManagementkeySetWriteCommandParams); diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 5126b30ed07250..6bf0a62201ab4b 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -3139,6 +3139,7 @@ class ChipClusters: "attributeName": "ClusterRevision", "attributeId": 0x0000FFFD, "type": "int", + "reportable": True, }, }, } @@ -3980,6 +3981,7 @@ class ChipClusters: "attributeName": "NOCs", "attributeId": 0x00000000, "type": "", + "reportable": True, }, 0x00000001: { "attributeName": "FabricsList", @@ -6200,18 +6202,21 @@ class ChipClusters: "attributeName": "HourFormat", "attributeId": 0x00000000, "type": "int", + "reportable": True, "writable": True, }, 0x00000001: { "attributeName": "ActiveCalendarType", "attributeId": 0x00000001, "type": "int", + "reportable": True, "writable": True, }, 0x00000002: { "attributeName": "SupportedCalendarTypes", "attributeId": 0x00000002, "type": "int", + "reportable": True, }, 0x0000FFF8: { "attributeName": "ServerGeneratedCommandList", @@ -6229,6 +6234,7 @@ class ChipClusters: "attributeName": "ClusterRevision", "attributeId": 0x0000FFFD, "type": "int", + "reportable": True, }, }, } diff --git a/src/credentials/tests/TestGroupDataProvider.cpp b/src/credentials/tests/TestGroupDataProvider.cpp index 24d388f64f5029..5f7b57e9724c4a 100644 --- a/src/credentials/tests/TestGroupDataProvider.cpp +++ b/src/credentials/tests/TestGroupDataProvider.cpp @@ -134,14 +134,11 @@ static TestListener sListener; bool CompareKeySets(const KeySet & keyset1, const KeySet & keyset2) { - VerifyOrReturnError(keyset1.policy == keyset2.policy, false); - VerifyOrReturnError(keyset1.num_keys_used == keyset2.num_keys_used, false); - VerifyOrReturnError(keyset1.epoch_keys[0].start_time == keyset2.epoch_keys[0].start_time, false); - VerifyOrReturnError(keyset1.epoch_keys[1].start_time == keyset2.epoch_keys[1].start_time, false); - VerifyOrReturnError(keyset1.epoch_keys[2].start_time == keyset2.epoch_keys[2].start_time, false); - VerifyOrReturnError(0 == memcmp(kZeroKey, keyset1.epoch_keys[0].key, EpochKey::kLengthBytes), false); - VerifyOrReturnError(0 == memcmp(kZeroKey, keyset1.epoch_keys[1].key, EpochKey::kLengthBytes), false); - VerifyOrReturnError(0 == memcmp(kZeroKey, keyset1.epoch_keys[2].key, EpochKey::kLengthBytes), false); + ReturnErrorOnFailure(keyset1.policy == keyset2.policy); + ReturnErrorOnFailure(keyset1.num_keys_used == keyset2.num_keys_used); + ReturnErrorOnFailure(keyset1.epoch_keys[0].start_time == keyset2.epoch_keys[0].start_time); + ReturnErrorOnFailure(keyset1.epoch_keys[1].start_time == keyset2.epoch_keys[1].start_time); + ReturnErrorOnFailure(keyset1.epoch_keys[2].start_time == keyset2.epoch_keys[2].start_time); return true; } @@ -829,11 +826,7 @@ void TestKeySetIterator(nlTestSuite * apSuite, void * apContext) while (it->Next(keyset) && count < expected_f1.size()) { NL_TEST_ASSERT(apSuite, expected_f1.count(keyset.keyset_id) > 0); - NL_TEST_ASSERT(apSuite, keyset.keyset_id == expected_f1[keyset.keyset_id].keyset_id); - NL_TEST_ASSERT(apSuite, keyset.policy == expected_f1[keyset.keyset_id].policy); - NL_TEST_ASSERT(apSuite, 0 == memcmp(kZeroKey, keyset.epoch_keys[0].key, sizeof(kZeroKey))); - NL_TEST_ASSERT(apSuite, 0 == memcmp(kZeroKey, keyset.epoch_keys[1].key, sizeof(kZeroKey))); - NL_TEST_ASSERT(apSuite, 0 == memcmp(kZeroKey, keyset.epoch_keys[2].key, sizeof(kZeroKey))); + NL_TEST_ASSERT(apSuite, CompareKeySets(keyset, expected_f1[keyset.keyset_id])); count++; } NL_TEST_ASSERT(apSuite, count == expected_f1.size()); @@ -854,11 +847,7 @@ void TestKeySetIterator(nlTestSuite * apSuite, void * apContext) while (it->Next(keyset) && count < expected_f2.size()) { NL_TEST_ASSERT(apSuite, expected_f2.count(keyset.keyset_id) > 0); - NL_TEST_ASSERT(apSuite, keyset.keyset_id == expected_f2[keyset.keyset_id].keyset_id); - NL_TEST_ASSERT(apSuite, keyset.policy == expected_f2[keyset.keyset_id].policy); - NL_TEST_ASSERT(apSuite, 0 == memcmp(kZeroKey, keyset.epoch_keys[0].key, sizeof(kZeroKey))); - NL_TEST_ASSERT(apSuite, 0 == memcmp(kZeroKey, keyset.epoch_keys[1].key, sizeof(kZeroKey))); - NL_TEST_ASSERT(apSuite, 0 == memcmp(kZeroKey, keyset.epoch_keys[2].key, sizeof(kZeroKey))); + NL_TEST_ASSERT(apSuite, CompareKeySets(keyset, expected_f2[keyset.keyset_id])); count++; } NL_TEST_ASSERT(apSuite, count == expected_f2.size()); diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm index 2527e6366f43ac..9b29e59dfbedcb 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm @@ -2557,20 +2557,16 @@ } } -void CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackBridge::OnSuccessFn(void * context, - const chip::app::DataModel::DecodableList & - value) +void CHIPBridgedDeviceBasicClientGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) { NSArray * _Nonnull objCValue; auto * array_0 = [NSMutableArray new]; auto iter_0 = value.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - CHIPGroupKeyManagementClusterGroupKeyMapStruct * newElement_0; - newElement_0 = [CHIPGroupKeyManagementClusterGroupKeyMapStruct new]; - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - newElement_0.groupId = [NSNumber numberWithUnsignedShort:entry_0.groupId]; - newElement_0.groupKeySetID = [NSNumber numberWithUnsignedShort:entry_0.groupKeySetID]; + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; [array_0 addObject:newElement_0]; } { // Scope for the error so we will know what it's named @@ -2601,42 +2597,16 @@ } } -void CHIPGroupKeyManagementGroupTableListAttributeCallbackBridge::OnSuccessFn(void * context, - const chip::app::DataModel::DecodableList & - value) +void CHIPBridgedDeviceBasicAttributeListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) { NSArray * _Nonnull objCValue; auto * array_0 = [NSMutableArray new]; auto iter_0 = value.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - CHIPGroupKeyManagementClusterGroupInfoMapStruct * newElement_0; - newElement_0 = [CHIPGroupKeyManagementClusterGroupInfoMapStruct new]; - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - newElement_0.groupId = [NSNumber numberWithUnsignedShort:entry_0.groupId]; - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.endpoints.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - NSNumber * newElement_2; - newElement_2 = [NSNumber numberWithUnsignedShort:entry_2]; - [array_2 addObject:newElement_2]; - } - { // Scope for the error so we will know what it's named - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - } - newElement_0.endpoints = array_2; - if (entry_0.groupName.HasValue()) { - newElement_0.groupName = [[NSString alloc] initWithBytes:entry_0.groupName.Value().data() - length:entry_0.groupName.Value().size() - encoding:NSUTF8StringEncoding]; - } else { - newElement_0.groupName = nil; - } + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; [array_0 addObject:newElement_0]; } { // Scope for the error so we will know what it's named @@ -4540,15 +4510,16 @@ } void CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackBridge::OnSuccessFn(void * context, - const chip::app::DataModel::DecodableList & value) + const chip::app::DataModel::DecodableList & + value) { NSArray * _Nonnull objCValue; auto * array_0 = [NSMutableArray new]; auto iter_0 = value.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - CHIPGroupKeyManagementClusterGroupKey * newElement_0; - newElement_0 = [CHIPGroupKeyManagementClusterGroupKey new]; + CHIPGroupKeyManagementClusterGroupKeyMapStruct * newElement_0; + newElement_0 = [CHIPGroupKeyManagementClusterGroupKeyMapStruct new]; newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; newElement_0.groupId = [NSNumber numberWithUnsignedShort:entry_0.groupId]; newElement_0.groupKeySetID = [NSNumber numberWithUnsignedShort:entry_0.groupKeySetID]; @@ -4582,16 +4553,17 @@ } void CHIPGroupKeyManagementGroupTableListAttributeCallbackBridge::OnSuccessFn(void * context, - const chip::app::DataModel::DecodableList & value) + const chip::app::DataModel::DecodableList & + value) { NSArray * _Nonnull objCValue; auto * array_0 = [NSMutableArray new]; auto iter_0 = value.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - CHIPGroupKeyManagementClusterGroupInfo * newElement_0; - newElement_0 = [CHIPGroupKeyManagementClusterGroupInfo new]; - newElement_0.fabricIndex = [NSNumber numberWithUnsignedShort:entry_0.fabricIndex]; + CHIPGroupKeyManagementClusterGroupInfoMapStruct * newElement_0; + newElement_0 = [CHIPGroupKeyManagementClusterGroupInfoMapStruct new]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; newElement_0.groupId = [NSNumber numberWithUnsignedShort:entry_0.groupId]; auto * array_2 = [NSMutableArray new]; auto iter_2 = entry_0.endpoints.begin(); @@ -4609,9 +4581,13 @@ } } newElement_0.endpoints = array_2; - newElement_0.groupName = [[NSString alloc] initWithBytes:entry_0.groupName.data() - length:entry_0.groupName.size() - encoding:NSUTF8StringEncoding]; + if (entry_0.groupName.HasValue()) { + newElement_0.groupName = [[NSString alloc] initWithBytes:entry_0.groupName.Value().data() + length:entry_0.groupName.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + newElement_0.groupName = nil; + } [array_0 addObject:newElement_0]; } { // Scope for the error so we will know what it's named diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h index b9cbb6b88b1d13..02c1f607ba2c8a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h @@ -2826,9 +2826,7 @@ class CHIPContentLauncherServerGeneratedCommandListListAttributeCallbackBridge CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::DecodableType> & value); + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); }; class CHIPContentLauncherServerGeneratedCommandListListAttributeCallbackSubscriptionBridge @@ -2857,9 +2855,7 @@ class CHIPContentLauncherClientGeneratedCommandListListAttributeCallbackBridge CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::GroupKeyManagement::Structs::GroupInfoMapStruct::DecodableType> & value); + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); }; class CHIPContentLauncherClientGeneratedCommandListListAttributeCallbackSubscriptionBridge @@ -3946,10 +3942,9 @@ class CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackBridge CHIPActionBlock action, bool keepAlive = false) : CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn( - void * context, - const chip::app::DataModel::DecodableList & - value); + static void OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::DecodableType> & value); }; class CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackSubscriptionBridge @@ -3977,10 +3972,9 @@ class CHIPGroupKeyManagementGroupTableListAttributeCallbackBridge CHIPActionBlock action, bool keepAlive = false) : CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn( - void * context, - const chip::app::DataModel::DecodableList & - value); + static void OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::GroupKeyManagement::Structs::GroupInfoMapStruct::DecodableType> & value); }; class CHIPGroupKeyManagementGroupTableListAttributeCallbackSubscriptionBridge diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h index 79fc1050c7700f..87433e1458d7eb 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h @@ -3203,6 +3203,11 @@ NS_ASSUME_NONNULL_BEGIN - (void)readAttributeClusterRevisionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)subscribeAttributeClusterRevisionWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; @end @@ -3983,6 +3988,10 @@ NS_ASSUME_NONNULL_BEGIN NSError * _Nullable error))completionHandler; - (void)readAttributeNOCsWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)subscribeAttributeNOCsWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; - (void)readAttributeFabricsListWithCompletionHandler:(void (^)( NSArray * _Nullable value, NSError * _Nullable error))completionHandler; @@ -6575,13 +6584,28 @@ NS_ASSUME_NONNULL_BEGIN - (void)readAttributeHourFormatWithCompletionHandler:(void (^)( NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; - (void)writeAttributeHourFormatWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)subscribeAttributeHourFormatWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; - (void)readAttributeActiveCalendarTypeWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; - (void)writeAttributeActiveCalendarTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)subscribeAttributeActiveCalendarTypeWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; - (void)readAttributeSupportedCalendarTypesWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)subscribeAttributeSupportedCalendarTypesWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; - (void)readAttributeServerGeneratedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; @@ -6603,6 +6627,11 @@ NS_ASSUME_NONNULL_BEGIN - (void)readAttributeClusterRevisionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)subscribeAttributeClusterRevisionWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; @end diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm index 028925e0a81194..2318f915056fba 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -13162,6 +13162,24 @@ new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(C }); } +- (void)subscribeAttributeClusterRevisionWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPInt16uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = LocalizationConfiguration::Attributes::ClusterRevision::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + minInterval, maxInterval, CHIPInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + }, + subscriptionEstablishedHandler); +} + @end @implementation CHIPLowPower @@ -16347,6 +16365,24 @@ new CHIPOperationalCredentialsNOCsListAttributeCallbackBridge( }); } +- (void)subscribeAttributeNOCsWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPOperationalCredentialsNOCsListAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = OperationalCredentials::Attributes::NOCs::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + minInterval, maxInterval, + CHIPOperationalCredentialsNOCsListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + }, + subscriptionEstablishedHandler); +} + - (void)readAttributeFabricsListWithCompletionHandler:(void (^)( NSArray * _Nullable value, NSError * _Nullable error))completionHandler { @@ -28004,6 +28040,24 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)subscribeAttributeHourFormatWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPTimeFormatLocalizationClusterHourFormatAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = TimeFormatLocalization::Attributes::HourFormat::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + minInterval, maxInterval, + CHIPTimeFormatLocalizationClusterHourFormatAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + }, + subscriptionEstablishedHandler); +} + - (void)readAttributeActiveCalendarTypeWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { @@ -28098,8 +28152,30 @@ new CHIPTimeFormatLocalizationServerGeneratedCommandListListAttributeCallbackBri }); } -- (void)readAttributeSupportedCalendarTypesWithCompletionHandler:(void (^)(NSArray * _Nullable value, - NSError * _Nullable error))completionHandler +- (void)subscribeAttributeServerGeneratedCommandListWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))reportHandler +{ + new CHIPTimeFormatLocalizationServerGeneratedCommandListListAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = TimeFormatLocalization::Attributes::ServerGeneratedCommandList::TypeInfo; + auto successFn + = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + minInterval, maxInterval, + CHIPTimeFormatLocalizationServerGeneratedCommandListListAttributeCallbackSubscriptionBridge:: + OnSubscriptionEstablished); + }, + subscriptionEstablishedHandler); +} + +- (void)readAttributeClientGeneratedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completionHandler { new CHIPTimeFormatLocalizationClientGeneratedCommandListListAttributeCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { @@ -28111,6 +28187,28 @@ new CHIPTimeFormatLocalizationClientGeneratedCommandListListAttributeCallbackBri }); } +- (void)subscribeAttributeClientGeneratedCommandListWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))reportHandler +{ + new CHIPTimeFormatLocalizationClientGeneratedCommandListListAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = TimeFormatLocalization::Attributes::ClientGeneratedCommandList::TypeInfo; + auto successFn + = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + minInterval, maxInterval, + CHIPTimeFormatLocalizationClientGeneratedCommandListListAttributeCallbackSubscriptionBridge:: + OnSubscriptionEstablished); + }, + subscriptionEstablishedHandler); +} + - (void)readAttributeClusterRevisionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { @@ -28122,6 +28220,24 @@ new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(C }); } +- (void)subscribeAttributeClusterRevisionWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPInt16uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = TimeFormatLocalization::Attributes::ClusterRevision::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + minInterval, maxInterval, CHIPInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + }, + subscriptionEstablishedHandler); +} + @end @implementation CHIPUnitLocalization diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm index b5faf8338752cf..ed2ce079d8f592 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm @@ -6860,12 +6860,12 @@ new CHIPDefaultSuccessCallbackBridge( } listFreer.add(listHolder_0); for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPGroupKeyManagementClusterGroupInfo class]]) { + if (![value[i_0] isKindOfClass:[CHIPGroupKeyManagementClusterGroupInfoMapStruct class]]) { // Wrong kind of value. return CHIP_ERROR_INVALID_ARGUMENT; } - auto element_0 = (CHIPGroupKeyManagementClusterGroupInfo *) value[i_0]; - listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedShortValue; + auto element_0 = (CHIPGroupKeyManagementClusterGroupInfoMapStruct *) value[i_0]; + listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; listHolder_0->mList[i_0].groupId = element_0.groupId.unsignedShortValue; { using ListType_2 = std::remove_reference_tmList[i_0].endpoints)>; @@ -6889,7 +6889,10 @@ new CHIPDefaultSuccessCallbackBridge( listHolder_0->mList[i_0].endpoints = ListType_2(); } } - listHolder_0->mList[i_0].groupName = [self asCharSpan:element_0.groupName]; + if (element_0.groupName != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].groupName.Emplace(); + definedValue_2 = [self asCharSpan:element_0.groupName]; + } } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -7575,7 +7578,8 @@ new CHIPDefaultSuccessCallbackBridge( }); } -- (void)writeAttributeGroupTableWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeClientGeneratedCommandListWithValue:(NSArray * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -7584,7 +7588,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = IlluminanceMeasurement::Attributes::AttributeList::TypeInfo; + using TypeInfo = IlluminanceMeasurement::Attributes::ClientGeneratedCommandList::TypeInfo; TypeInfo::Type cppValue; { using ListType_0 = std::remove_reference_t; @@ -7596,39 +7600,51 @@ new CHIPDefaultSuccessCallbackBridge( } listFreer.add(listHolder_0); for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPGroupKeyManagementClusterGroupInfoMapStruct class]]) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { // Wrong kind of value. return CHIP_ERROR_INVALID_ARGUMENT; } - auto element_0 = (CHIPGroupKeyManagementClusterGroupInfoMapStruct *) value[i_0]; - listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; - listHolder_0->mList[i_0].groupId = element_0.groupId.unsignedShortValue; - { - using ListType_2 = std::remove_reference_tmList[i_0].endpoints)>; - using ListMemberType_2 = ListMemberTypeGetter::Type; - if (element_0.endpoints.count != 0) { - auto * listHolder_2 = new ListHolder(element_0.endpoints.count); - if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_2); - for (size_t i_2 = 0; i_2 < element_0.endpoints.count; ++i_2) { - if (![element_0.endpoints[i_2] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_2 = (NSNumber *) element_0.endpoints[i_2]; - listHolder_2->mList[i_2] = element_2.unsignedShortValue; - } - listHolder_0->mList[i_0].endpoints = ListType_2(listHolder_2->mList, element_0.endpoints.count); - } else { - listHolder_0->mList[i_0].endpoints = ListType_2(); - } - } - if (element_0.groupName != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].groupName.Emplace(); - definedValue_2 = [self asCharSpan:element_0.groupName]; + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = IlluminanceMeasurement::Attributes::AttributeList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; } cppValue = ListType_0(listHolder_0->mList, value.count); } else { diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 2428a0275298e8..b2fefb5ccbdf79 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -41732,6 +41732,446 @@ - (void)testSendClusterTestGroupKeyManagementCluster_000002_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTestGroupKeyManagementCluster_000003_AddGroup +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Add Group 1"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + __auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:17U]; + params.groupName = @"Group #1"; + [cluster addGroupWithParams:params + completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Add Group 1 Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = values.status; + XCTAssertEqual([actualValue unsignedCharValue], 0); + } + { + id actualValue = values.groupId; + XCTAssertEqual([actualValue unsignedShortValue], 17U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestGroupKeyManagementCluster_000004_AddGroup +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Add Group 2"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + __auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init]; + params.groupId = [NSNumber numberWithUnsignedShort:18U]; + params.groupName = @"Group #2"; + [cluster addGroupWithParams:params + completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Add Group 2 Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = values.status; + XCTAssertEqual([actualValue unsignedCharValue], 0); + } + { + id actualValue = values.groupId; + XCTAssertEqual([actualValue unsignedShortValue], 18U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestGroupKeyManagementCluster_000005_KeySetWrite +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Write 1"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[CHIPGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = [NSNumber numberWithUnsignedShort:257U]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:0]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf" length:16]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:1110000ULL]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf" length:16]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:1110001ULL]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf" length:16]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:1110002ULL]; + + [cluster keySetWriteWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"KeySet Write 1 Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestGroupKeyManagementCluster_000006_KeySetWrite +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Write 2"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetWriteParams alloc] init]; + params.groupKeySet = [[CHIPGroupKeyManagementClusterGroupKeySetStruct alloc] init]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySetID = [NSNumber numberWithUnsignedShort:258U]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:1]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey0 = + [[NSData alloc] initWithBytes:"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" length:16]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:2110000ULL]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey1 = + [[NSData alloc] initWithBytes:"\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef" length:16]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:2110001ULL]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochKey2 = + [[NSData alloc] initWithBytes:"\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff" length:16]; + ((CHIPGroupKeyManagementClusterGroupKeySetStruct *) params.groupKeySet).epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:2110002ULL]; + + [cluster keySetWriteWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"KeySet Write 2 Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestGroupKeyManagementCluster_000007_KeySetRead +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Read"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:257U]; + [cluster + keySetReadWithParams:params + completionHandler:^(CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"KeySet Read Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = values.groupKeySet; + XCTAssertEqual( + [((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySetID unsignedShortValue], 257U); + XCTAssertEqual( + [((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySecurityPolicy unsignedCharValue], + 0); + XCTAssertTrue(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey0 == nil); + XCTAssertFalse(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0 == nil); + XCTAssertEqual( + [((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0 unsignedLongLongValue], + 1110000ULL); + XCTAssertTrue(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey1 == nil); + XCTAssertFalse(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1 == nil); + XCTAssertEqual( + [((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1 unsignedLongLongValue], + 1110001ULL); + XCTAssertTrue(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey2 == nil); + XCTAssertFalse(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2 == nil); + XCTAssertEqual( + [((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2 unsignedLongLongValue], + 1110002ULL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestGroupKeyManagementCluster_000008_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write Group Keys"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + id groupKeyMapArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPGroupKeyManagementClusterGroupKeyMapStruct alloc] init]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupId = [NSNumber numberWithUnsignedShort:17U]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[0]).groupKeySetID = [NSNumber numberWithUnsignedShort:257U]; + + temp_0[1] = [[CHIPGroupKeyManagementClusterGroupKeyMapStruct alloc] init]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).groupId = [NSNumber numberWithUnsignedShort:18U]; + ((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) temp_0[1]).groupKeySetID = [NSNumber numberWithUnsignedShort:258U]; + + groupKeyMapArgument = temp_0; + } + [cluster writeAttributeGroupKeyMapWithValue:groupKeyMapArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write Group Keys Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestGroupKeyManagementCluster_000009_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read Group Keys"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeGroupKeyMapWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read Group Keys Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue count], 2); + XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[0]).fabricIndex unsignedCharValue], 1); + XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[0]).groupId unsignedShortValue], 17U); + XCTAssertEqual( + [((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[0]).groupKeySetID unsignedShortValue], 257U); + XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[1]).fabricIndex unsignedCharValue], 1); + XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[1]).groupId unsignedShortValue], 18U); + XCTAssertEqual( + [((CHIPGroupKeyManagementClusterGroupKeyMapStruct *) actualValue[1]).groupKeySetID unsignedShortValue], 258U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestGroupKeyManagementCluster_000010_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read GroupTable"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeGroupTableWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read GroupTable Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue count], 2); + XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).fabricIndex unsignedCharValue], 1); + XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).groupId unsignedShortValue], 17U); + XCTAssertTrue( + [((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[0]).groupName isEqualToString:@"Group #1"]); + XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[1]).fabricIndex unsignedCharValue], 1); + XCTAssertEqual([((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[1]).groupId unsignedShortValue], 18U); + XCTAssertTrue( + [((CHIPGroupKeyManagementClusterGroupInfoMapStruct *) actualValue[1]).groupName isEqualToString:@"Group #2"]); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestGroupKeyManagementCluster_000011_KeySetRemove +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Remove 1"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetRemoveParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:257U]; + [cluster keySetRemoveWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"KeySet Remove 1 Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestGroupKeyManagementCluster_000012_KeySetRead +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Read (removed)"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:257U]; + [cluster + keySetReadWithParams:params + completionHandler:^(CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"KeySet Read (removed) Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_NOT_FOUND); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestGroupKeyManagementCluster_000013_KeySetRead +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Read (not removed)"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:258U]; + [cluster + keySetReadWithParams:params + completionHandler:^(CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"KeySet Read (not removed) Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = values.groupKeySet; + XCTAssertEqual( + [((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySetID unsignedShortValue], 258U); + XCTAssertEqual( + [((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).groupKeySecurityPolicy unsignedCharValue], + 1); + XCTAssertTrue(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey0 == nil); + XCTAssertFalse(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0 == nil); + XCTAssertEqual( + [((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime0 unsignedLongLongValue], + 2110000ULL); + XCTAssertTrue(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey1 == nil); + XCTAssertFalse(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1 == nil); + XCTAssertEqual( + [((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime1 unsignedLongLongValue], + 2110001ULL); + XCTAssertTrue(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochKey2 == nil); + XCTAssertFalse(((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2 == nil); + XCTAssertEqual( + [((CHIPGroupKeyManagementClusterGroupKeySetStruct *) actualValue).epochStartTime2 unsignedLongLongValue], + 2110002ULL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestGroupKeyManagementCluster_000014_RemoveAllGroups +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Remove All"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster removeAllGroupsWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Remove All Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestGroupKeyManagementCluster_000015_KeySetRemove +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Remove 2"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetRemoveParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:258U]; + [cluster keySetRemoveWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"KeySet Remove 2 Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestGroupKeyManagementCluster_000016_KeySetRead +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"KeySet Read (also removed)"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + __auto_type * params = [[CHIPGroupKeyManagementClusterKeySetReadParams alloc] init]; + params.groupKeySetID = [NSNumber numberWithUnsignedShort:258U]; + [cluster + keySetReadWithParams:params + completionHandler:^(CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"KeySet Read (also removed) Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_NOT_FOUND); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} - (void)testSendClusterTestIdentifyCluster_000000_WaitForCommissionee { 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 ecc6f78b49b287..70b60334b3db68 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -48,12 +48,17 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ + /* Endpoint: 0, Cluster: Unit Localization (server), big-endian */ \ + \ + /* 260 - FeatureMap, */ \ + 0x00, 0x00, 0x00, 0x01, \ + \ /* Endpoint: 0, Cluster: General Commissioning (server), big-endian */ \ \ - /* 284 - Breadcrumb, */ \ + /* 264 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 292 - BasicCommissioningInfoList, */ \ + /* 272 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -69,258 +74,258 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 546 - FeatureMap, */ \ + /* 526 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x06, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), big-endian */ \ \ - /* 550 - Networks, */ \ + /* 530 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 562 - LastConnectErrorValue, */ \ + /* 542 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 566 - FeatureMap, */ \ + /* 546 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), big-endian */ \ \ - /* 570 - UpTime, */ \ + /* 550 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 578 - TotalOperationalHours, */ \ + /* 558 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), big-endian */ \ \ - /* 582 - CurrentHeapFree, */ \ + /* 562 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 590 - CurrentHeapUsed, */ \ + /* 570 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 598 - CurrentHeapHighWatermark, */ \ + /* 578 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 606 - FeatureMap, */ \ + /* 586 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), big-endian */ \ \ - /* 610 - NetworkName, */ \ + /* 590 - NetworkName, */ \ 0x00, 0x00, \ \ - /* 612 - ExtendedPanId, */ \ + /* 592 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 620 - OverrunCount, */ \ + /* 600 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 628 - PartitionId, */ \ + /* 608 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 632 - TxTotalCount, */ \ + /* 612 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 636 - TxUnicastCount, */ \ + /* 616 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 640 - TxBroadcastCount, */ \ + /* 620 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 644 - TxAckRequestedCount, */ \ + /* 624 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 648 - TxAckedCount, */ \ + /* 628 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 652 - TxNoAckRequestedCount, */ \ + /* 632 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 656 - TxDataCount, */ \ + /* 636 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 660 - TxDataPollCount, */ \ + /* 640 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 664 - TxBeaconCount, */ \ + /* 644 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 668 - TxBeaconRequestCount, */ \ + /* 648 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 672 - TxOtherCount, */ \ + /* 652 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 676 - TxRetryCount, */ \ + /* 656 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 680 - TxDirectMaxRetryExpiryCount, */ \ + /* 660 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 684 - TxIndirectMaxRetryExpiryCount, */ \ + /* 664 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 688 - TxErrCcaCount, */ \ + /* 668 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 692 - TxErrAbortCount, */ \ + /* 672 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 696 - TxErrBusyChannelCount, */ \ + /* 676 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 700 - RxTotalCount, */ \ + /* 680 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 704 - RxUnicastCount, */ \ + /* 684 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 708 - RxBroadcastCount, */ \ + /* 688 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 712 - RxDataCount, */ \ + /* 692 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 716 - RxDataPollCount, */ \ + /* 696 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 720 - RxBeaconCount, */ \ + /* 700 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 724 - RxBeaconRequestCount, */ \ + /* 704 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 728 - RxOtherCount, */ \ + /* 708 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 732 - RxAddressFilteredCount, */ \ + /* 712 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 736 - RxDestAddrFilteredCount, */ \ + /* 716 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 740 - RxDuplicatedCount, */ \ + /* 720 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 744 - RxErrNoFrameCount, */ \ + /* 724 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 748 - RxErrUnknownNeighborCount, */ \ + /* 728 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 752 - RxErrInvalidSrcAddrCount, */ \ + /* 732 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 756 - RxErrSecCount, */ \ + /* 736 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 760 - RxErrFcsCount, */ \ + /* 740 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 764 - RxErrOtherCount, */ \ + /* 744 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 768 - ActiveTimestamp, */ \ + /* 748 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 776 - PendingTimestamp, */ \ + /* 756 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 784 - delay, */ \ + /* 764 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 788 - ChannelMask, */ \ + /* 768 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 795 - FeatureMap, */ \ + /* 775 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0F, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), big-endian */ \ \ - /* 799 - BeaconLostCount, */ \ + /* 779 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 803 - BeaconRxCount, */ \ + /* 783 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 807 - PacketMulticastRxCount, */ \ + /* 787 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 811 - PacketMulticastTxCount, */ \ + /* 791 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 815 - PacketUnicastRxCount, */ \ + /* 795 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 819 - PacketUnicastTxCount, */ \ + /* 799 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 823 - CurrentMaxRate, */ \ + /* 803 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 831 - OverrunCount, */ \ + /* 811 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 839 - FeatureMap, */ \ + /* 819 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), big-endian */ \ \ - /* 843 - PacketRxCount, */ \ + /* 823 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 851 - PacketTxCount, */ \ + /* 831 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 859 - TxErrCount, */ \ + /* 839 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 867 - CollisionCount, */ \ + /* 847 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 875 - OverrunCount, */ \ + /* 855 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 883 - TimeSinceReset, */ \ + /* 863 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 891 - FeatureMap, */ \ + /* 871 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ /* Endpoint: 1, Cluster: On/Off (server), big-endian */ \ \ - /* 895 - FeatureMap, */ \ + /* 875 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Level Control (server), big-endian */ \ \ - /* 899 - FeatureMap, */ \ + /* 879 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ /* Endpoint: 1, Cluster: Power Source (server), big-endian */ \ \ - /* 903 - BatteryVoltage, */ \ + /* 883 - BatteryVoltage, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 907 - BatteryTimeRemaining, */ \ + /* 887 - BatteryTimeRemaining, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 911 - ActiveBatteryFaults, */ \ + /* 891 - ActiveBatteryFaults, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 919 - FeatureMap, */ \ + /* 899 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Network Commissioning (server), big-endian */ \ \ - /* 923 - Networks, */ \ + /* 903 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 935 - LastConnectErrorValue, */ \ + /* 915 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 939 - FeatureMap, */ \ + /* 919 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Bridged Device Basic (server), big-endian */ \ @@ -330,12 +335,12 @@ \ /* Endpoint: 1, Cluster: Switch (server), big-endian */ \ \ - /* 943 - FeatureMap, */ \ + /* 927 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Fixed Label (server), big-endian */ \ \ - /* 947 - label list, */ \ + /* 931 - label list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -353,21 +358,21 @@ \ /* Endpoint: 1, Cluster: Mode Select (server), big-endian */ \ \ - /* 1201 - Description, */ \ + /* 1185 - Description, */ \ 6, 'C', 'o', 'f', 'f', 'e', 'e', \ \ /* Endpoint: 1, Cluster: Door Lock (server), big-endian */ \ \ - /* 1208 - DoorOpenEvents, */ \ + /* 1192 - DoorOpenEvents, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1212 - DoorClosedEvents, */ \ + /* 1196 - DoorClosedEvents, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1216 - Language, */ \ + /* 1200 - Language, */ \ 2, 'e', 'n', \ \ - /* 1219 - AutoRelockTime, */ \ + /* 1203 - AutoRelockTime, */ \ 0x00, 0x00, 0x00, 0x60, \ \ /* 953 - FeatureMap, */ \ @@ -375,36 +380,36 @@ \ /* Endpoint: 1, Cluster: Window Covering (server), big-endian */ \ \ - /* 1223 - FeatureMap, */ \ + /* 1211 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server), big-endian */ \ \ - /* 1227 - LifetimeRunningHours, */ \ + /* 1215 - LifetimeRunningHours, */ \ 0x00, 0x00, 0x00, \ \ - /* 1230 - Power, */ \ + /* 1218 - Power, */ \ 0x00, 0x00, 0x00, \ \ - /* 1233 - LifetimeEnergyConsumed, */ \ + /* 1221 - LifetimeEnergyConsumed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1237 - FeatureMap, */ \ + /* 1225 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Thermostat (server), big-endian */ \ \ - /* 1241 - FeatureMap, */ \ + /* 1229 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0B, \ \ /* Endpoint: 1, Cluster: IAS Zone (server), big-endian */ \ \ - /* 1245 - IAS CIE address, */ \ + /* 1233 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Channel (server), big-endian */ \ \ - /* 1253 - channel list, */ \ + /* 1241 - channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -422,7 +427,7 @@ \ /* Endpoint: 1, Cluster: Target Navigator (server), big-endian */ \ \ - /* 1507 - target navigator list, */ \ + /* 1495 - target navigator list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -440,24 +445,24 @@ \ /* Endpoint: 1, Cluster: Media Playback (server), big-endian */ \ \ - /* 1761 - start time, */ \ + /* 1749 - start time, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, \ \ - /* 1769 - duration, */ \ + /* 1757 - duration, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1777 - playback speed, */ \ + /* 1765 - playback speed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1781 - seek range end, */ \ + /* 1769 - seek range end, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1789 - seek range start, */ \ + /* 1777 - seek range start, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Media Input (server), big-endian */ \ \ - /* 1797 - media input list, */ \ + /* 1785 - media input list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -475,7 +480,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), big-endian */ \ \ - /* 2051 - accept header list, */ \ + /* 2039 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -491,12 +496,12 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2305 - supported streaming protocols, */ \ + /* 2293 - supported streaming protocols, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Audio Output (server), big-endian */ \ \ - /* 2309 - audio output list, */ \ + /* 2297 - audio output list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -514,7 +519,7 @@ \ /* Endpoint: 1, Cluster: Application Launcher (server), big-endian */ \ \ - /* 2563 - application launcher list, */ \ + /* 2551 - application launcher list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -532,67 +537,67 @@ \ /* Endpoint: 1, Cluster: Application Basic (server), big-endian */ \ \ - /* 2817 - allowed vendor list, */ \ + /* 2805 - allowed vendor list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Test Cluster (server), big-endian */ \ \ - /* 2849 - bitmap32, */ \ + /* 2837 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2853 - bitmap64, */ \ + /* 2841 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2861 - int24u, */ \ + /* 2849 - int24u, */ \ 0x00, 0x00, 0x00, \ \ - /* 2864 - int32u, */ \ + /* 2852 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2868 - int40u, */ \ + /* 2856 - int40u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2873 - int48u, */ \ + /* 2861 - int48u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2879 - int56u, */ \ + /* 2867 - int56u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2886 - int64u, */ \ + /* 2874 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2894 - int24s, */ \ + /* 2882 - int24s, */ \ 0x00, 0x00, 0x00, \ \ - /* 2897 - int32s, */ \ + /* 2885 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2901 - int40s, */ \ + /* 2889 - int40s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2906 - int48s, */ \ + /* 2894 - int48s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2912 - int56s, */ \ + /* 2900 - int56s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2919 - int64s, */ \ + /* 2907 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2927 - float_single, */ \ + /* 2915 - float_single, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2931 - float_double, */ \ + /* 2919 - float_double, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2939 - epoch_us, */ \ + /* 2927 - epoch_us, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2947 - epoch_s, */ \ + /* 2935 - epoch_s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2951 - list_long_octet_string, */ \ + /* 2939 - list_long_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -647,65 +652,65 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3951 - nullable_bitmap32, */ \ + /* 3939 - nullable_bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3955 - nullable_bitmap64, */ \ + /* 3943 - nullable_bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3963 - nullable_int24u, */ \ + /* 3951 - nullable_int24u, */ \ 0x00, 0x00, 0x00, \ \ - /* 3966 - nullable_int32u, */ \ + /* 3954 - nullable_int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3970 - nullable_int40u, */ \ + /* 3958 - nullable_int40u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3975 - nullable_int48u, */ \ + /* 3963 - nullable_int48u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3981 - nullable_int56u, */ \ + /* 3969 - nullable_int56u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3988 - nullable_int64u, */ \ + /* 3976 - nullable_int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3996 - nullable_int24s, */ \ + /* 3984 - nullable_int24s, */ \ 0x00, 0x00, 0x00, \ \ - /* 3999 - nullable_int32s, */ \ + /* 3987 - nullable_int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4003 - nullable_int40s, */ \ + /* 3991 - nullable_int40s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4008 - nullable_int48s, */ \ + /* 3996 - nullable_int48s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4014 - nullable_int56s, */ \ + /* 4002 - nullable_int56s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4021 - nullable_int64s, */ \ + /* 4009 - nullable_int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4029 - nullable_float_single, */ \ + /* 4017 - nullable_float_single, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4033 - nullable_float_double, */ \ + /* 4021 - nullable_float_double, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server), big-endian */ \ \ - /* 4041 - measurement type, */ \ + /* 4029 - measurement type, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4045 - total active power, */ \ + /* 4033 - total active power, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 2, Cluster: On/Off (server), big-endian */ \ \ - /* 4049 - FeatureMap, */ \ + /* 4037 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } @@ -734,12 +739,17 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ + /* Endpoint: 0, Cluster: Unit Localization (server), little-endian */ \ + \ + /* 260 - FeatureMap, */ \ + 0x01, 0x00, 0x00, 0x00, \ + \ /* Endpoint: 0, Cluster: General Commissioning (server), little-endian */ \ \ - /* 284 - Breadcrumb, */ \ + /* 264 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 292 - BasicCommissioningInfoList, */ \ + /* 272 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -755,258 +765,258 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 546 - FeatureMap, */ \ + /* 526 - FeatureMap, */ \ 0x06, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), little-endian */ \ \ - /* 550 - Networks, */ \ + /* 530 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 562 - LastConnectErrorValue, */ \ + /* 542 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 566 - FeatureMap, */ \ + /* 546 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), little-endian */ \ \ - /* 570 - UpTime, */ \ + /* 550 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 578 - TotalOperationalHours, */ \ + /* 558 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), little-endian */ \ \ - /* 582 - CurrentHeapFree, */ \ + /* 562 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 590 - CurrentHeapUsed, */ \ + /* 570 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 598 - CurrentHeapHighWatermark, */ \ + /* 578 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 606 - FeatureMap, */ \ + /* 586 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), little-endian */ \ \ - /* 610 - NetworkName, */ \ + /* 590 - NetworkName, */ \ 0x00, 0x00, \ \ - /* 612 - ExtendedPanId, */ \ + /* 592 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 620 - OverrunCount, */ \ + /* 600 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 628 - PartitionId, */ \ + /* 608 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 632 - TxTotalCount, */ \ + /* 612 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 636 - TxUnicastCount, */ \ + /* 616 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 640 - TxBroadcastCount, */ \ + /* 620 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 644 - TxAckRequestedCount, */ \ + /* 624 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 648 - TxAckedCount, */ \ + /* 628 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 652 - TxNoAckRequestedCount, */ \ + /* 632 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 656 - TxDataCount, */ \ + /* 636 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 660 - TxDataPollCount, */ \ + /* 640 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 664 - TxBeaconCount, */ \ + /* 644 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 668 - TxBeaconRequestCount, */ \ + /* 648 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 672 - TxOtherCount, */ \ + /* 652 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 676 - TxRetryCount, */ \ + /* 656 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 680 - TxDirectMaxRetryExpiryCount, */ \ + /* 660 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 684 - TxIndirectMaxRetryExpiryCount, */ \ + /* 664 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 688 - TxErrCcaCount, */ \ + /* 668 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 692 - TxErrAbortCount, */ \ + /* 672 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 696 - TxErrBusyChannelCount, */ \ + /* 676 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 700 - RxTotalCount, */ \ + /* 680 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 704 - RxUnicastCount, */ \ + /* 684 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 708 - RxBroadcastCount, */ \ + /* 688 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 712 - RxDataCount, */ \ + /* 692 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 716 - RxDataPollCount, */ \ + /* 696 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 720 - RxBeaconCount, */ \ + /* 700 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 724 - RxBeaconRequestCount, */ \ + /* 704 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 728 - RxOtherCount, */ \ + /* 708 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 732 - RxAddressFilteredCount, */ \ + /* 712 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 736 - RxDestAddrFilteredCount, */ \ + /* 716 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 740 - RxDuplicatedCount, */ \ + /* 720 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 744 - RxErrNoFrameCount, */ \ + /* 724 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 748 - RxErrUnknownNeighborCount, */ \ + /* 728 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 752 - RxErrInvalidSrcAddrCount, */ \ + /* 732 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 756 - RxErrSecCount, */ \ + /* 736 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 760 - RxErrFcsCount, */ \ + /* 740 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 764 - RxErrOtherCount, */ \ + /* 744 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 768 - ActiveTimestamp, */ \ + /* 748 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 776 - PendingTimestamp, */ \ + /* 756 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 784 - delay, */ \ + /* 764 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 788 - ChannelMask, */ \ + /* 768 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 795 - FeatureMap, */ \ + /* 775 - FeatureMap, */ \ 0x0F, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), little-endian */ \ \ - /* 799 - BeaconLostCount, */ \ + /* 779 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 803 - BeaconRxCount, */ \ + /* 783 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 807 - PacketMulticastRxCount, */ \ + /* 787 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 811 - PacketMulticastTxCount, */ \ + /* 791 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 815 - PacketUnicastRxCount, */ \ + /* 795 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 819 - PacketUnicastTxCount, */ \ + /* 799 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 823 - CurrentMaxRate, */ \ + /* 803 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 831 - OverrunCount, */ \ + /* 811 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 839 - FeatureMap, */ \ + /* 819 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), little-endian */ \ \ - /* 843 - PacketRxCount, */ \ + /* 823 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 851 - PacketTxCount, */ \ + /* 831 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 859 - TxErrCount, */ \ + /* 839 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 867 - CollisionCount, */ \ + /* 847 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 875 - OverrunCount, */ \ + /* 855 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 883 - TimeSinceReset, */ \ + /* 863 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 891 - FeatureMap, */ \ + /* 871 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: On/Off (server), little-endian */ \ \ - /* 895 - FeatureMap, */ \ + /* 875 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Level Control (server), little-endian */ \ \ - /* 899 - FeatureMap, */ \ + /* 879 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Power Source (server), little-endian */ \ \ - /* 903 - BatteryVoltage, */ \ + /* 883 - BatteryVoltage, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 907 - BatteryTimeRemaining, */ \ + /* 887 - BatteryTimeRemaining, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 911 - ActiveBatteryFaults, */ \ + /* 891 - ActiveBatteryFaults, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 919 - FeatureMap, */ \ + /* 899 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Network Commissioning (server), little-endian */ \ \ - /* 923 - Networks, */ \ + /* 903 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 935 - LastConnectErrorValue, */ \ + /* 915 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 939 - FeatureMap, */ \ + /* 919 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Bridged Device Basic (server), little-endian */ \ @@ -1016,12 +1026,12 @@ \ /* Endpoint: 1, Cluster: Switch (server), little-endian */ \ \ - /* 943 - FeatureMap, */ \ + /* 927 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Fixed Label (server), little-endian */ \ \ - /* 947 - label list, */ \ + /* 931 - label list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1039,21 +1049,21 @@ \ /* Endpoint: 1, Cluster: Mode Select (server), little-endian */ \ \ - /* 1201 - Description, */ \ + /* 1185 - Description, */ \ 6, 'C', 'o', 'f', 'f', 'e', 'e', \ \ /* Endpoint: 1, Cluster: Door Lock (server), little-endian */ \ \ - /* 1208 - DoorOpenEvents, */ \ + /* 1192 - DoorOpenEvents, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1212 - DoorClosedEvents, */ \ + /* 1196 - DoorClosedEvents, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1216 - Language, */ \ + /* 1200 - Language, */ \ 2, 'e', 'n', \ \ - /* 1219 - AutoRelockTime, */ \ + /* 1203 - AutoRelockTime, */ \ 0x60, 0x00, 0x00, 0x00, \ \ /* 953 - FeatureMap, */ \ @@ -1061,36 +1071,36 @@ \ /* Endpoint: 1, Cluster: Window Covering (server), little-endian */ \ \ - /* 1223 - FeatureMap, */ \ + /* 1211 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server), little-endian */ \ \ - /* 1227 - LifetimeRunningHours, */ \ + /* 1215 - LifetimeRunningHours, */ \ 0x00, 0x00, 0x00, \ \ - /* 1230 - Power, */ \ + /* 1218 - Power, */ \ 0x00, 0x00, 0x00, \ \ - /* 1233 - LifetimeEnergyConsumed, */ \ + /* 1221 - LifetimeEnergyConsumed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1237 - FeatureMap, */ \ + /* 1225 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Thermostat (server), little-endian */ \ \ - /* 1241 - FeatureMap, */ \ + /* 1229 - FeatureMap, */ \ 0x0B, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: IAS Zone (server), little-endian */ \ \ - /* 1245 - IAS CIE address, */ \ + /* 1233 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Channel (server), little-endian */ \ \ - /* 1253 - channel list, */ \ + /* 1241 - channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1108,7 +1118,7 @@ \ /* Endpoint: 1, Cluster: Target Navigator (server), little-endian */ \ \ - /* 1507 - target navigator list, */ \ + /* 1495 - target navigator list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1126,24 +1136,24 @@ \ /* Endpoint: 1, Cluster: Media Playback (server), little-endian */ \ \ - /* 1761 - start time, */ \ + /* 1749 - start time, */ \ 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1769 - duration, */ \ + /* 1757 - duration, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1777 - playback speed, */ \ + /* 1765 - playback speed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1781 - seek range end, */ \ + /* 1769 - seek range end, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1789 - seek range start, */ \ + /* 1777 - seek range start, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Media Input (server), little-endian */ \ \ - /* 1797 - media input list, */ \ + /* 1785 - media input list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1161,7 +1171,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), little-endian */ \ \ - /* 2051 - accept header list, */ \ + /* 2039 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1177,12 +1187,12 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2305 - supported streaming protocols, */ \ + /* 2293 - supported streaming protocols, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Audio Output (server), little-endian */ \ \ - /* 2309 - audio output list, */ \ + /* 2297 - audio output list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1200,7 +1210,7 @@ \ /* Endpoint: 1, Cluster: Application Launcher (server), little-endian */ \ \ - /* 2563 - application launcher list, */ \ + /* 2551 - application launcher list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1218,67 +1228,67 @@ \ /* Endpoint: 1, Cluster: Application Basic (server), little-endian */ \ \ - /* 2817 - allowed vendor list, */ \ + /* 2805 - allowed vendor list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Test Cluster (server), little-endian */ \ \ - /* 2849 - bitmap32, */ \ + /* 2837 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2853 - bitmap64, */ \ + /* 2841 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2861 - int24u, */ \ + /* 2849 - int24u, */ \ 0x00, 0x00, 0x00, \ \ - /* 2864 - int32u, */ \ + /* 2852 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2868 - int40u, */ \ + /* 2856 - int40u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2873 - int48u, */ \ + /* 2861 - int48u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2879 - int56u, */ \ + /* 2867 - int56u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2886 - int64u, */ \ + /* 2874 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2894 - int24s, */ \ + /* 2882 - int24s, */ \ 0x00, 0x00, 0x00, \ \ - /* 2897 - int32s, */ \ + /* 2885 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2901 - int40s, */ \ + /* 2889 - int40s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2906 - int48s, */ \ + /* 2894 - int48s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2912 - int56s, */ \ + /* 2900 - int56s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2919 - int64s, */ \ + /* 2907 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2927 - float_single, */ \ + /* 2915 - float_single, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2931 - float_double, */ \ + /* 2919 - float_double, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2939 - epoch_us, */ \ + /* 2927 - epoch_us, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2947 - epoch_s, */ \ + /* 2935 - epoch_s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2951 - list_long_octet_string, */ \ + /* 2939 - list_long_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1333,65 +1343,65 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3951 - nullable_bitmap32, */ \ + /* 3939 - nullable_bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3955 - nullable_bitmap64, */ \ + /* 3943 - nullable_bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3963 - nullable_int24u, */ \ + /* 3951 - nullable_int24u, */ \ 0x00, 0x00, 0x00, \ \ - /* 3966 - nullable_int32u, */ \ + /* 3954 - nullable_int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3970 - nullable_int40u, */ \ + /* 3958 - nullable_int40u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3975 - nullable_int48u, */ \ + /* 3963 - nullable_int48u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3981 - nullable_int56u, */ \ + /* 3969 - nullable_int56u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3988 - nullable_int64u, */ \ + /* 3976 - nullable_int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3996 - nullable_int24s, */ \ + /* 3984 - nullable_int24s, */ \ 0x00, 0x00, 0x00, \ \ - /* 3999 - nullable_int32s, */ \ + /* 3987 - nullable_int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4003 - nullable_int40s, */ \ + /* 3991 - nullable_int40s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4008 - nullable_int48s, */ \ + /* 3996 - nullable_int48s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4014 - nullable_int56s, */ \ + /* 4002 - nullable_int56s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4021 - nullable_int64s, */ \ + /* 4009 - nullable_int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4029 - nullable_float_single, */ \ + /* 4017 - nullable_float_single, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4033 - nullable_float_double, */ \ + /* 4021 - nullable_float_double, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server), little-endian */ \ \ - /* 4041 - measurement type, */ \ + /* 4029 - measurement type, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4045 - total active power, */ \ + /* 4033 - total active power, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 2, Cluster: On/Off (server), little-endian */ \ \ - /* 4049 - FeatureMap, */ \ + /* 4037 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } @@ -1508,12 +1518,11 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Binding (server) */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ @@ -1522,9 +1531,8 @@ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* ACL */ \ { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_EMPTY_DEFAULT() }, /* Extension */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + ZAP_EMPTY_DEFAULT() }, /* Extension */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Basic (server) */ \ { 0x00000000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(10) }, /* DataModelRevision */ \ @@ -1570,7 +1578,7 @@ \ /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_SIMPLE_DEFAULT(0) }, /* DefaultOtaProviders */ \ + ZAP_EMPTY_DEFAULT() }, /* DefaultOtaProviders */ \ { 0x00000001, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(1) }, /* UpdatePossible */ \ { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* UpdateState */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0) }, /* UpdateStateProgress */ \ @@ -1603,30 +1611,30 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x00000000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(284) }, /* Breadcrumb */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(292) }, /* BasicCommissioningInfoList */ \ + { 0x00000000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(264) }, /* Breadcrumb */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(272) }, /* BasicCommissioningInfoList */ \ { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* RegulatoryConfig */ \ { 0x00000003, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* LocationCapability */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(546) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(526) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* MaxNetworks */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(550) }, /* Networks */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(530) }, /* Networks */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ScanMaxTimeSeconds */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ConnectMaxTimeSeconds */ \ { 0x00000004, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* InterfaceEnabled */ \ { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkingStatus */ \ { 0x00000006, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkID */ \ - { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(562) }, /* LastConnectErrorValue */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(566) }, /* FeatureMap */ \ + { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(542) }, /* LastConnectErrorValue */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(546) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NetworkInterfaces */ \ { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* RebootCount */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(570) }, /* UpTime */ \ - { 0x00000003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(578) }, /* TotalOperationalHours */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(550) }, /* UpTime */ \ + { 0x00000003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(558) }, /* TotalOperationalHours */ \ { 0x00000004, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BootReasons */ \ { 0x00000005, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* ActiveHardwareFaults */ \ @@ -1637,23 +1645,23 @@ \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ThreadMetrics */ \ - { 0x00000001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(582) }, /* CurrentHeapFree */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(590) }, /* CurrentHeapUsed */ \ - { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(598) }, /* CurrentHeapHighWatermark */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(606) }, /* FeatureMap */ \ + { 0x00000001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(562) }, /* CurrentHeapFree */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(570) }, /* CurrentHeapUsed */ \ + { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(578) }, /* CurrentHeapHighWatermark */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(586) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x00000001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ - { 0x00000002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(610) }, /* NetworkName */ \ + { 0x00000002, ZAP_TYPE(CHAR_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(590) }, /* NetworkName */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ - { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(612) }, /* ExtendedPanId */ \ + { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(592) }, /* ExtendedPanId */ \ { 0x00000005, ZAP_TYPE(OCTET_STRING), 18, 0, ZAP_EMPTY_DEFAULT() }, /* MeshLocalPrefix */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(620) }, /* OverrunCount */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(600) }, /* OverrunCount */ \ { 0x00000007, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NeighborTableList */ \ { 0x00000008, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* RouteTableList */ \ - { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(628) }, /* PartitionId */ \ + { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(608) }, /* PartitionId */ \ { 0x0000000A, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* weighting */ \ { 0x0000000B, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* DataVersion */ \ { 0x0000000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* StableDataVersion */ \ @@ -1666,50 +1674,50 @@ { 0x00000013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PartitionIdChangeCount */ \ { 0x00000014, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* BetterPartitionAttachAttemptCount */ \ { 0x00000015, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ParentChangeCount */ \ - { 0x00000016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(632) }, /* TxTotalCount */ \ - { 0x00000017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(636) }, /* TxUnicastCount */ \ - { 0x00000018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(640) }, /* TxBroadcastCount */ \ - { 0x00000019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(644) }, /* TxAckRequestedCount */ \ - { 0x0000001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(648) }, /* TxAckedCount */ \ - { 0x0000001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(652) }, /* TxNoAckRequestedCount */ \ - { 0x0000001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(656) }, /* TxDataCount */ \ - { 0x0000001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(660) }, /* TxDataPollCount */ \ - { 0x0000001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(664) }, /* TxBeaconCount */ \ - { 0x0000001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(668) }, /* TxBeaconRequestCount */ \ - { 0x00000020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(672) }, /* TxOtherCount */ \ - { 0x00000021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(676) }, /* TxRetryCount */ \ - { 0x00000022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(680) }, /* TxDirectMaxRetryExpiryCount */ \ - { 0x00000023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(684) }, /* TxIndirectMaxRetryExpiryCount */ \ - { 0x00000024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(688) }, /* TxErrCcaCount */ \ - { 0x00000025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(692) }, /* TxErrAbortCount */ \ - { 0x00000026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(696) }, /* TxErrBusyChannelCount */ \ - { 0x00000027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(700) }, /* RxTotalCount */ \ - { 0x00000028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(704) }, /* RxUnicastCount */ \ - { 0x00000029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(708) }, /* RxBroadcastCount */ \ - { 0x0000002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(712) }, /* RxDataCount */ \ - { 0x0000002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(716) }, /* RxDataPollCount */ \ - { 0x0000002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(720) }, /* RxBeaconCount */ \ - { 0x0000002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(724) }, /* RxBeaconRequestCount */ \ - { 0x0000002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(728) }, /* RxOtherCount */ \ - { 0x0000002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(732) }, /* RxAddressFilteredCount */ \ - { 0x00000030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(736) }, /* RxDestAddrFilteredCount */ \ - { 0x00000031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(740) }, /* RxDuplicatedCount */ \ - { 0x00000032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(744) }, /* RxErrNoFrameCount */ \ - { 0x00000033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(748) }, /* RxErrUnknownNeighborCount */ \ - { 0x00000034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(752) }, /* RxErrInvalidSrcAddrCount */ \ - { 0x00000035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(756) }, /* RxErrSecCount */ \ - { 0x00000036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(760) }, /* RxErrFcsCount */ \ - { 0x00000037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(764) }, /* RxErrOtherCount */ \ - { 0x00000038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(768) }, /* ActiveTimestamp */ \ - { 0x00000039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(776) }, /* PendingTimestamp */ \ - { 0x0000003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(784) }, /* delay */ \ + { 0x00000016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(612) }, /* TxTotalCount */ \ + { 0x00000017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(616) }, /* TxUnicastCount */ \ + { 0x00000018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(620) }, /* TxBroadcastCount */ \ + { 0x00000019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(624) }, /* TxAckRequestedCount */ \ + { 0x0000001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(628) }, /* TxAckedCount */ \ + { 0x0000001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(632) }, /* TxNoAckRequestedCount */ \ + { 0x0000001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(636) }, /* TxDataCount */ \ + { 0x0000001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(640) }, /* TxDataPollCount */ \ + { 0x0000001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(644) }, /* TxBeaconCount */ \ + { 0x0000001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(648) }, /* TxBeaconRequestCount */ \ + { 0x00000020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(652) }, /* TxOtherCount */ \ + { 0x00000021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(656) }, /* TxRetryCount */ \ + { 0x00000022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(660) }, /* TxDirectMaxRetryExpiryCount */ \ + { 0x00000023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(664) }, /* TxIndirectMaxRetryExpiryCount */ \ + { 0x00000024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(668) }, /* TxErrCcaCount */ \ + { 0x00000025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(672) }, /* TxErrAbortCount */ \ + { 0x00000026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(676) }, /* TxErrBusyChannelCount */ \ + { 0x00000027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(680) }, /* RxTotalCount */ \ + { 0x00000028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(684) }, /* RxUnicastCount */ \ + { 0x00000029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(688) }, /* RxBroadcastCount */ \ + { 0x0000002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(692) }, /* RxDataCount */ \ + { 0x0000002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(696) }, /* RxDataPollCount */ \ + { 0x0000002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(700) }, /* RxBeaconCount */ \ + { 0x0000002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(704) }, /* RxBeaconRequestCount */ \ + { 0x0000002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(708) }, /* RxOtherCount */ \ + { 0x0000002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(712) }, /* RxAddressFilteredCount */ \ + { 0x00000030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(716) }, /* RxDestAddrFilteredCount */ \ + { 0x00000031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(720) }, /* RxDuplicatedCount */ \ + { 0x00000032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(724) }, /* RxErrNoFrameCount */ \ + { 0x00000033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(728) }, /* RxErrUnknownNeighborCount */ \ + { 0x00000034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(732) }, /* RxErrInvalidSrcAddrCount */ \ + { 0x00000035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(736) }, /* RxErrSecCount */ \ + { 0x00000036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(740) }, /* RxErrFcsCount */ \ + { 0x00000037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(744) }, /* RxErrOtherCount */ \ + { 0x00000038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(748) }, /* ActiveTimestamp */ \ + { 0x00000039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(756) }, /* PendingTimestamp */ \ + { 0x0000003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(764) }, /* delay */ \ { 0x0000003B, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SecurityPolicy */ \ - { 0x0000003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(788) }, /* ChannelMask */ \ + { 0x0000003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(768) }, /* ChannelMask */ \ { 0x0000003D, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* OperationalDatasetComponents */ \ { 0x0000003E, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* ActiveNetworkFaultsList */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(795) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(775) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ @@ -1718,36 +1726,36 @@ { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* WiFiVersion */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChannelNumber */ \ { 0x00000004, ZAP_TYPE(INT8S), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Rssi */ \ - { 0x00000005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(799) }, /* BeaconLostCount */ \ - { 0x00000006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(803) }, /* BeaconRxCount */ \ - { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(807) }, /* PacketMulticastRxCount */ \ - { 0x00000008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(811) }, /* PacketMulticastTxCount */ \ - { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(815) }, /* PacketUnicastRxCount */ \ - { 0x0000000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(819) }, /* PacketUnicastTxCount */ \ - { 0x0000000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(823) }, /* CurrentMaxRate */ \ - { 0x0000000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(831) }, /* OverrunCount */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(839) }, /* FeatureMap */ \ + { 0x00000005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(779) }, /* BeaconLostCount */ \ + { 0x00000006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(783) }, /* BeaconRxCount */ \ + { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(787) }, /* PacketMulticastRxCount */ \ + { 0x00000008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(791) }, /* PacketMulticastTxCount */ \ + { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(795) }, /* PacketUnicastRxCount */ \ + { 0x0000000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(799) }, /* PacketUnicastTxCount */ \ + { 0x0000000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(803) }, /* CurrentMaxRate */ \ + { 0x0000000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(811) }, /* OverrunCount */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(819) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* PHYRate */ \ { 0x00000001, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* FullDuplex */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(843) }, /* PacketRxCount */ \ - { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(851) }, /* PacketTxCount */ \ - { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(859) }, /* TxErrCount */ \ - { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(867) }, /* CollisionCount */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(875) }, /* OverrunCount */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(823) }, /* PacketRxCount */ \ + { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(831) }, /* PacketTxCount */ \ + { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(839) }, /* TxErrCount */ \ + { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(847) }, /* CollisionCount */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(855) }, /* OverrunCount */ \ { 0x00000007, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* CarrierDetect */ \ - { 0x00000008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(883) }, /* TimeSinceReset */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(891) }, /* FeatureMap */ \ + { 0x00000008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(863) }, /* TimeSinceReset */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(871) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { 0x00000000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* WindowStatus */ \ + { 0x00000000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ { 0x00000001, ZAP_TYPE(FABRIC_IDX), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* AdminVendorId */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ @@ -1809,7 +1817,7 @@ { 0x00004001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OnTime */ \ { 0x00004002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OffWaitTime */ \ { 0x00004003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* StartUpOnOff */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(895) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(875) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: On/off Switch Configuration (server) */ \ @@ -1841,7 +1849,7 @@ { 0x00004000, ZAP_TYPE(INT8U), 1, \ ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(255) }, /* start up current level */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(899) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(879) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Binary Input (Basic) (server) */ \ @@ -1852,12 +1860,11 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Binding (server) */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ @@ -1866,33 +1873,32 @@ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* action list */ \ { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* endpoint list */ \ { 0x00000002, ZAP_TYPE(LONG_CHAR_STRING), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_EMPTY_DEFAULT() }, /* setup url */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + ZAP_EMPTY_DEFAULT() }, /* setup url */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Power Source (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* Status */ \ { 0x00000001, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* Order */ \ { 0x00000002, ZAP_TYPE(CHAR_STRING), 61, 0, ZAP_EMPTY_DEFAULT() }, /* Description */ \ - { 0x0000000B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(903) }, /* BatteryVoltage */ \ + { 0x0000000B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(883) }, /* BatteryVoltage */ \ { 0x0000000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryPercentRemaining */ \ - { 0x0000000D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(907) }, /* BatteryTimeRemaining */ \ + { 0x0000000D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(887) }, /* BatteryTimeRemaining */ \ { 0x0000000E, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryChargeLevel */ \ - { 0x00000012, ZAP_TYPE(ARRAY), 8, 0, ZAP_LONG_DEFAULTS_INDEX(911) }, /* ActiveBatteryFaults */ \ + { 0x00000012, ZAP_TYPE(ARRAY), 8, 0, ZAP_LONG_DEFAULTS_INDEX(891) }, /* ActiveBatteryFaults */ \ { 0x0000001A, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryChargeState */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(919) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(899) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Network Commissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* MaxNetworks */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(923) }, /* Networks */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(903) }, /* Networks */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ScanMaxTimeSeconds */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ConnectMaxTimeSeconds */ \ { 0x00000004, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* InterfaceEnabled */ \ { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkingStatus */ \ { 0x00000006, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkID */ \ - { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(935) }, /* LastConnectErrorValue */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(939) }, /* FeatureMap */ \ + { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(915) }, /* LastConnectErrorValue */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(919) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Bridged Device Basic (server) */ \ @@ -1921,11 +1927,11 @@ { 0x00000000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(2) }, /* number of positions */ \ { 0x00000001, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* current position */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(2) }, /* multi press max */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(943) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(927) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Fixed Label (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(947) }, /* label list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(931) }, /* label list */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: User Label (server) */ \ @@ -1938,21 +1944,21 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Mode Select (server) */ \ - { 0x00000000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* CurrentMode */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* SupportedModes */ \ - { 0x00000002, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OnMode */ \ - { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* StartUpMode */ \ - { 0x00000004, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(1201) }, /* Description */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* CurrentMode */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SupportedModes */ \ + { 0x00000002, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OnMode */ \ + { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* StartUpMode */ \ + { 0x00000004, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(1185) }, /* Description */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Door Lock (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(2) }, /* LockState */ \ { 0x00000001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LockType */ \ { 0x00000002, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ActuatorEnabled */ \ { 0x00000003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_EMPTY_DEFAULT() }, /* DoorState */ \ - { 0x00000004, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1208) }, /* DoorOpenEvents */ \ + { 0x00000004, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1192) }, /* DoorOpenEvents */ \ { 0x00000005, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(1212) }, /* DoorClosedEvents */ \ + ZAP_LONG_DEFAULTS_INDEX(1196) }, /* DoorClosedEvents */ \ { 0x00000006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* OpenPeriod */ \ { 0x00000011, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(10) }, /* NumberOfTotalUsersSupported */ \ { 0x00000012, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(10) }, /* NumberOfPINUsersSupported */ \ @@ -1965,8 +1971,8 @@ { 0x00000019, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(20) }, /* MaxRFIDCodeLength */ \ { 0x0000001A, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(10) }, /* MinRFIDCodeLength */ \ { 0x0000001B, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(1) }, /* CredentialRulesSupport */ \ - { 0x00000021, ZAP_TYPE(CHAR_STRING), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1216) }, /* Language */ \ - { 0x00000023, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1219) }, /* AutoRelockTime */ \ + { 0x00000021, ZAP_TYPE(CHAR_STRING), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1200) }, /* Language */ \ + { 0x00000023, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1203) }, /* AutoRelockTime */ \ { 0x00000024, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(6) }, /* SoundVolume */ \ { 0x00000025, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -2006,16 +2012,21 @@ { 0x0000000D, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* EndProductType */ \ { 0x0000000E, ZAP_TYPE(PERCENT100THS), 2, ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(500) }, /* CurrentPositionLiftPercent100ths */ \ - { 0x0000000F, ZAP_TYPE(PERCENT100THS), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_SIMPLE_DEFAULT(500) }, /* CurrentPositionTiltPercent100ths */ \ - { 0x00000010, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* InstalledOpenLimitLift */ \ - { 0x00000011, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* InstalledClosedLimitLift */ \ - { 0x00000012, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* InstalledOpenLimitTilt */ \ - { 0x00000013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* InstalledClosedLimitTilt */ \ - { 0x00000017, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + { 0x0000000F, ZAP_TYPE(PERCENT100THS), 2, ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(500) }, /* CurrentPositionTiltPercent100ths */ \ + { 0x00000010, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(TOKENIZE), \ + ZAP_SIMPLE_DEFAULT(0x0000) }, /* InstalledOpenLimitLift */ \ + { 0x00000011, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(TOKENIZE), \ + ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* InstalledClosedLimitLift */ \ + { 0x00000012, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(TOKENIZE), \ + ZAP_SIMPLE_DEFAULT(0x0000) }, /* InstalledOpenLimitTilt */ \ + { 0x00000013, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(TOKENIZE), \ + ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* InstalledClosedLimitTilt */ \ + { 0x00000017, ZAP_TYPE(BITMAP8), 1, \ + ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(10) }, /* Mode */ \ { 0x0000001A, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* SafetyStatus */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1223) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1211) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Barrier Control (server) */ \ @@ -2045,16 +2056,16 @@ { 0x00000013, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Capacity */ \ { 0x00000014, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Speed */ \ { 0x00000015, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(1227) }, /* LifetimeRunningHours */ \ - { 0x00000016, ZAP_TYPE(INT24U), 3, 0, ZAP_LONG_DEFAULTS_INDEX(1230) }, /* Power */ \ + ZAP_LONG_DEFAULTS_INDEX(1215) }, /* LifetimeRunningHours */ \ + { 0x00000016, ZAP_TYPE(INT24U), 3, 0, ZAP_LONG_DEFAULTS_INDEX(1218) }, /* Power */ \ { 0x00000017, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(1233) }, /* LifetimeEnergyConsumed */ \ + ZAP_LONG_DEFAULTS_INDEX(1221) }, /* LifetimeEnergyConsumed */ \ { 0x00000020, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(11) }, /* OperationMode */ \ { 0x00000021, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(12) }, /* ControlMode */ \ { 0x00000022, ZAP_TYPE(BITMAP16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* AlarmMask */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1237) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1225) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Thermostat (server) */ \ @@ -2084,7 +2095,7 @@ { 0x00000020, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* start of week */ \ { 0x00000021, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(7) }, /* number of weekly transitions */ \ { 0x00000022, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(4) }, /* number of daily transitions */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1241) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1229) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ @@ -2207,7 +2218,7 @@ { 0x00000001, ZAP_TYPE(ENUM16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* zone type */ \ { 0x00000002, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* zone status */ \ { 0x00000010, ZAP_TYPE(NODE_ID), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(1245) }, /* IAS CIE address */ \ + ZAP_LONG_DEFAULTS_INDEX(1233) }, /* IAS CIE address */ \ { 0x00000011, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xff) }, /* Zone ID */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ @@ -2216,25 +2227,25 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Channel (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1253) }, /* channel list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1241) }, /* channel list */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Target Navigator (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1507) }, /* target navigator list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1495) }, /* target navigator list */ \ { 0x00000001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current navigator target */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Media Playback (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* playback state */ \ - { 0x00000001, ZAP_TYPE(EPOCH_US), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1761) }, /* start time */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1769) }, /* duration */ \ - { 0x00000004, ZAP_TYPE(SINGLE), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1777) }, /* playback speed */ \ - { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1781) }, /* seek range end */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1789) }, /* seek range start */ \ + { 0x00000001, ZAP_TYPE(EPOCH_US), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1749) }, /* start time */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1757) }, /* duration */ \ + { 0x00000004, ZAP_TYPE(SINGLE), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1765) }, /* playback speed */ \ + { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1769) }, /* seek range end */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1777) }, /* seek range start */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Media Input (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1797) }, /* media input list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1785) }, /* media input list */ \ { 0x00000001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current media input */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ @@ -2245,18 +2256,18 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Content Launcher (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2051) }, /* accept header list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2039) }, /* accept header list */ \ { 0x00000001, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(2305) }, /* supported streaming protocols */ \ + ZAP_LONG_DEFAULTS_INDEX(2293) }, /* supported streaming protocols */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Audio Output (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2309) }, /* audio output list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2297) }, /* audio output list */ \ { 0x00000001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current audio output */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Application Launcher (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2563) }, /* application launcher list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2551) }, /* application launcher list */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Application Basic (server) */ \ @@ -2266,7 +2277,7 @@ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* product id */ \ { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* application status */ \ { 0x00000006, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application version */ \ - { 0x00000007, ZAP_TYPE(ARRAY), 32, 0, ZAP_LONG_DEFAULTS_INDEX(2817) }, /* allowed vendor list */ \ + { 0x00000007, ZAP_TYPE(ARRAY), 32, 0, ZAP_LONG_DEFAULTS_INDEX(2805) }, /* allowed vendor list */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Account Login (server) */ \ @@ -2276,28 +2287,28 @@ { 0x00000000, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(false) }, /* boolean */ \ { 0x00000001, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap8 */ \ { 0x00000002, ZAP_TYPE(BITMAP16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap16 */ \ - { 0x00000003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2849) }, /* bitmap32 */ \ - { 0x00000004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2853) }, /* bitmap64 */ \ + { 0x00000003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2837) }, /* bitmap32 */ \ + { 0x00000004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2841) }, /* bitmap64 */ \ { 0x00000005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8u */ \ { 0x00000006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16u */ \ - { 0x00000007, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2861) }, /* int24u */ \ - { 0x00000008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2864) }, /* int32u */ \ - { 0x00000009, ZAP_TYPE(INT40U), 5, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2868) }, /* int40u */ \ - { 0x0000000A, ZAP_TYPE(INT48U), 6, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2873) }, /* int48u */ \ - { 0x0000000B, ZAP_TYPE(INT56U), 7, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2879) }, /* int56u */ \ - { 0x0000000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2886) }, /* int64u */ \ + { 0x00000007, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2849) }, /* int24u */ \ + { 0x00000008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2852) }, /* int32u */ \ + { 0x00000009, ZAP_TYPE(INT40U), 5, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2856) }, /* int40u */ \ + { 0x0000000A, ZAP_TYPE(INT48U), 6, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2861) }, /* int48u */ \ + { 0x0000000B, ZAP_TYPE(INT56U), 7, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2867) }, /* int56u */ \ + { 0x0000000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2874) }, /* int64u */ \ { 0x0000000D, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8s */ \ { 0x0000000E, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16s */ \ - { 0x0000000F, ZAP_TYPE(INT24S), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2894) }, /* int24s */ \ - { 0x00000010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2897) }, /* int32s */ \ - { 0x00000011, ZAP_TYPE(INT40S), 5, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2901) }, /* int40s */ \ - { 0x00000012, ZAP_TYPE(INT48S), 6, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2906) }, /* int48s */ \ - { 0x00000013, ZAP_TYPE(INT56S), 7, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2912) }, /* int56s */ \ - { 0x00000014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2919) }, /* int64s */ \ + { 0x0000000F, ZAP_TYPE(INT24S), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2882) }, /* int24s */ \ + { 0x00000010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2885) }, /* int32s */ \ + { 0x00000011, ZAP_TYPE(INT40S), 5, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2889) }, /* int40s */ \ + { 0x00000012, ZAP_TYPE(INT48S), 6, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2894) }, /* int48s */ \ + { 0x00000013, ZAP_TYPE(INT56S), 7, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2900) }, /* int56s */ \ + { 0x00000014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2907) }, /* int64s */ \ { 0x00000015, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum8 */ \ { 0x00000016, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum16 */ \ - { 0x00000017, ZAP_TYPE(SINGLE), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2927) }, /* float_single */ \ - { 0x00000018, ZAP_TYPE(DOUBLE), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2931) }, /* float_double */ \ + { 0x00000017, ZAP_TYPE(SINGLE), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2915) }, /* float_single */ \ + { 0x00000018, ZAP_TYPE(DOUBLE), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2919) }, /* float_double */ \ { 0x00000019, ZAP_TYPE(OCTET_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* octet_string */ \ { 0x0000001A, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* list_int8u */ \ @@ -2310,8 +2321,8 @@ { 0x0000001E, ZAP_TYPE(CHAR_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* char_string */ \ { 0x0000001F, ZAP_TYPE(LONG_CHAR_STRING), 1002, ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* long_char_string */ \ - { 0x00000020, ZAP_TYPE(EPOCH_US), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2939) }, /* epoch_us */ \ - { 0x00000021, ZAP_TYPE(EPOCH_S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2947) }, /* epoch_s */ \ + { 0x00000020, ZAP_TYPE(EPOCH_US), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2927) }, /* epoch_us */ \ + { 0x00000021, ZAP_TYPE(EPOCH_S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2935) }, /* epoch_s */ \ { 0x00000022, ZAP_TYPE(VENDOR_ID), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* vendor_id */ \ { 0x00000023, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* list_nullables_and_optionals_struct */ \ @@ -2326,7 +2337,7 @@ ZAP_MIN_MAX_DEFAULTS_INDEX(34) }, /* range_restricted_int16u */ \ { 0x00000029, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(35) }, /* range_restricted_int16s */ \ - { 0x0000002A, ZAP_TYPE(ARRAY), 1000, 0, ZAP_LONG_DEFAULTS_INDEX(2951) }, /* list_long_octet_string */ \ + { 0x0000002A, ZAP_TYPE(ARRAY), 1000, 0, ZAP_LONG_DEFAULTS_INDEX(2939) }, /* list_long_octet_string */ \ { 0x0000002B, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* list_fabric_scoped */ \ { 0x00000030, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(MUST_USE_TIMED_WRITE), \ @@ -2342,49 +2353,49 @@ { 0x00008002, ZAP_TYPE(BITMAP16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_bitmap16 */ \ { 0x00008003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3951) }, /* nullable_bitmap32 */ \ + ZAP_LONG_DEFAULTS_INDEX(3939) }, /* nullable_bitmap32 */ \ { 0x00008004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3955) }, /* nullable_bitmap64 */ \ + ZAP_LONG_DEFAULTS_INDEX(3943) }, /* nullable_bitmap64 */ \ { 0x00008005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int8u */ \ { 0x00008006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int16u */ \ { 0x00008007, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3963) }, /* nullable_int24u */ \ + ZAP_LONG_DEFAULTS_INDEX(3951) }, /* nullable_int24u */ \ { 0x00008008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3966) }, /* nullable_int32u */ \ + ZAP_LONG_DEFAULTS_INDEX(3954) }, /* nullable_int32u */ \ { 0x00008009, ZAP_TYPE(INT40U), 5, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3970) }, /* nullable_int40u */ \ + ZAP_LONG_DEFAULTS_INDEX(3958) }, /* nullable_int40u */ \ { 0x0000800A, ZAP_TYPE(INT48U), 6, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3975) }, /* nullable_int48u */ \ + ZAP_LONG_DEFAULTS_INDEX(3963) }, /* nullable_int48u */ \ { 0x0000800B, ZAP_TYPE(INT56U), 7, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3981) }, /* nullable_int56u */ \ + ZAP_LONG_DEFAULTS_INDEX(3969) }, /* nullable_int56u */ \ { 0x0000800C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3988) }, /* nullable_int64u */ \ + ZAP_LONG_DEFAULTS_INDEX(3976) }, /* nullable_int64u */ \ { 0x0000800D, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int8s */ \ { 0x0000800E, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int16s */ \ { 0x0000800F, ZAP_TYPE(INT24S), 3, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3996) }, /* nullable_int24s */ \ + ZAP_LONG_DEFAULTS_INDEX(3984) }, /* nullable_int24s */ \ { 0x00008010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3999) }, /* nullable_int32s */ \ + ZAP_LONG_DEFAULTS_INDEX(3987) }, /* nullable_int32s */ \ { 0x00008011, ZAP_TYPE(INT40S), 5, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4003) }, /* nullable_int40s */ \ + ZAP_LONG_DEFAULTS_INDEX(3991) }, /* nullable_int40s */ \ { 0x00008012, ZAP_TYPE(INT48S), 6, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4008) }, /* nullable_int48s */ \ + ZAP_LONG_DEFAULTS_INDEX(3996) }, /* nullable_int48s */ \ { 0x00008013, ZAP_TYPE(INT56S), 7, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4014) }, /* nullable_int56s */ \ + ZAP_LONG_DEFAULTS_INDEX(4002) }, /* nullable_int56s */ \ { 0x00008014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4021) }, /* nullable_int64s */ \ + ZAP_LONG_DEFAULTS_INDEX(4009) }, /* nullable_int64s */ \ { 0x00008015, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_enum8 */ \ { 0x00008016, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_enum16 */ \ { 0x00008017, ZAP_TYPE(SINGLE), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4029) }, /* nullable_float_single */ \ + ZAP_LONG_DEFAULTS_INDEX(4017) }, /* nullable_float_single */ \ { 0x00008018, ZAP_TYPE(DOUBLE), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4033) }, /* nullable_float_double */ \ + ZAP_LONG_DEFAULTS_INDEX(4021) }, /* nullable_float_double */ \ { 0x00008019, ZAP_TYPE(OCTET_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_EMPTY_DEFAULT() }, /* nullable_octet_string */ \ { 0x0000801E, ZAP_TYPE(CHAR_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ @@ -2409,8 +2420,8 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ - { 0x00000000, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(4041) }, /* measurement type */ \ - { 0x00000304, ZAP_TYPE(INT32S), 4, 0, ZAP_LONG_DEFAULTS_INDEX(4045) }, /* total active power */ \ + { 0x00000000, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(4029) }, /* measurement type */ \ + { 0x00000304, ZAP_TYPE(INT32S), 4, 0, ZAP_LONG_DEFAULTS_INDEX(4033) }, /* total active power */ \ { 0x00000505, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xffff) }, /* rms voltage */ \ { 0x00000506, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* rms voltage min */ \ { 0x00000507, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* rms voltage max */ \ @@ -2432,16 +2443,15 @@ { 0x00004001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OnTime */ \ { 0x00004002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OffWaitTime */ \ { 0x00004003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* StartUpOnOff */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(4049) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(4037) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 2, Cluster: Occupancy Sensing (server) */ \ { 0x00000000, ZAP_TYPE(BITMAP8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* occupancy */ \ @@ -2880,306 +2890,848 @@ #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask #define GENERATED_CLUSTER_COUNT 76 -#define GENERATED_CLUSTERS \ - { \ - { 0x00000003, \ - ZAP_ATTRIBUTE_INDEX(0), \ - 3, \ - 5, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayIdentifyServer }, /* Endpoint: 0, Cluster: Identify (server) */ \ - { 0x00000004, \ - ZAP_ATTRIBUTE_INDEX(3), \ - 2, \ - 3, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayGroupsServer }, /* Endpoint: 0, Cluster: Groups (server) */ \ - { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(5), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { \ - 0x0000001E, ZAP_ATTRIBUTE_INDEX(10), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Binding (server) */ \ - { \ - 0x0000001F, ZAP_ATTRIBUTE_INDEX(11), 3, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Access Control (server) */ \ - { 0x00000028, \ - ZAP_ATTRIBUTE_INDEX(14), \ - 20, \ - 39, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayBasicServer }, /* Endpoint: 0, Cluster: Basic (server) */ \ - { \ - 0x00000029, ZAP_ATTRIBUTE_INDEX(34), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 0, Cluster: OTA Software Update Provider (client) */ \ - { \ - 0x0000002A, ZAP_ATTRIBUTE_INDEX(35), 5, 5, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */ \ - { 0x0000002B, \ - ZAP_ATTRIBUTE_INDEX(40), \ - 3, \ - 292, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayLocalizationConfigurationServer }, /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ - { 0x0000002C, \ - ZAP_ATTRIBUTE_INDEX(43), \ - 4, \ - 4, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayTimeFormatLocalizationServer }, /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ - { 0x0000002D, \ - ZAP_ATTRIBUTE_INDEX(47), \ - 3, \ - 7, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayUnitLocalizationServer }, /* Endpoint: 0, Cluster: Unit Localization (server) */ \ - { \ - 0x0000002E, ZAP_ATTRIBUTE_INDEX(50), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Power Source Configuration (server) */ \ - { \ - 0x00000030, ZAP_ATTRIBUTE_INDEX(49), 6, 270, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { \ - 0x00000031, ZAP_ATTRIBUTE_INDEX(55), 10, 60, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { \ - 0x00000032, ZAP_ATTRIBUTE_INDEX(68), 0, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ - { \ - 0x00000033, ZAP_ATTRIBUTE_INDEX(68), 9, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ - { \ - 0x00000034, ZAP_ATTRIBUTE_INDEX(77), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { \ - 0x00000035, ZAP_ATTRIBUTE_INDEX(83), 65, 247, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { \ - 0x00000036, ZAP_ATTRIBUTE_INDEX(148), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ - { \ - 0x00000037, ZAP_ATTRIBUTE_INDEX(163), 11, 57, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ - { \ - 0x0000003C, ZAP_ATTRIBUTE_INDEX(174), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(178), 7, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { \ - 0x0000003F, ZAP_ATTRIBUTE_INDEX(185), 5, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Group Key Management (server) */ \ - { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(190), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ - { \ - 0x00000041, ZAP_ATTRIBUTE_INDEX(192), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: User Label (server) */ \ - { \ - 0x00000405, ZAP_ATTRIBUTE_INDEX(194), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ - { 0x00000003, \ - ZAP_ATTRIBUTE_INDEX(198), \ - 3, \ - 5, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayIdentifyServer }, /* Endpoint: 1, Cluster: Identify (server) */ \ - { 0x00000004, \ - ZAP_ATTRIBUTE_INDEX(201), \ - 2, \ - 3, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayGroupsServer }, /* Endpoint: 1, Cluster: Groups (server) */ \ - { 0x00000005, \ - ZAP_ATTRIBUTE_INDEX(203), \ - 6, \ - 8, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayScenesServer }, /* Endpoint: 1, Cluster: Scenes (server) */ \ - { 0x00000006, \ - ZAP_ATTRIBUTE_INDEX(209), \ - 7, \ - 13, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ - { \ - 0x00000007, ZAP_ATTRIBUTE_INDEX(216), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: On/off Switch Configuration (server) */ \ - { 0x00000008, \ - ZAP_ATTRIBUTE_INDEX(219), \ - 16, \ - 27, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ - { \ - 0x0000000F, ZAP_ATTRIBUTE_INDEX(235), 4, 5, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Binary Input (Basic) (server) */ \ - { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(239), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ - { \ - 0x0000001E, ZAP_ATTRIBUTE_INDEX(244), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Binding (server) */ \ - { \ - 0x00000025, ZAP_ATTRIBUTE_INDEX(245), 4, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Bridged Actions (server) */ \ - { \ - 0x0000002F, ZAP_ATTRIBUTE_INDEX(246), 11, 88, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Power Source (server) */ \ - { \ - 0x00000031, ZAP_ATTRIBUTE_INDEX(257), 10, 60, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Network Commissioning (server) */ \ - { \ - 0x00000039, ZAP_ATTRIBUTE_INDEX(270), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Bridged Device Basic (server) */ \ - { \ - 0x0000003B, ZAP_ATTRIBUTE_INDEX(271), 5, 9, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Switch (server) */ \ - { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(273), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Fixed Label (server) */ \ - { \ - 0x00000041, ZAP_ATTRIBUTE_INDEX(278), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: User Label (server) */ \ - { \ - 0x00000045, ZAP_ATTRIBUTE_INDEX(280), 2, 3, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Boolean State (server) */ \ - { \ - 0x00000050, ZAP_ATTRIBUTE_INDEX(282), 6, 38, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Mode Select (server) */ \ - { 0x00000101, \ - ZAP_ATTRIBUTE_INDEX(288), \ - 32, \ - 54, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | \ - ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayDoorLockServer }, /* Endpoint: 1, Cluster: Door Lock (server) */ \ - { \ - 0x00000102, ZAP_ATTRIBUTE_INDEX(320), 20, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Window Covering (server) */ \ - { \ - 0x00000103, ZAP_ATTRIBUTE_INDEX(340), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Barrier Control (server) */ \ - { \ - 0x00000200, \ - ZAP_ATTRIBUTE_INDEX(345), \ - 26, \ - 54, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayPumpConfigurationAndControlServer \ - }, /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ - { 0x00000201, \ - ZAP_ATTRIBUTE_INDEX(371), \ - 19, \ - 34, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayThermostatServer }, /* Endpoint: 1, Cluster: Thermostat (server) */ \ - { \ - 0x00000204, \ - ZAP_ATTRIBUTE_INDEX(390), \ - 4, \ - 5, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayThermostatUserInterfaceConfigurationServer \ - }, /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ - { 0x00000300, \ - ZAP_ATTRIBUTE_INDEX(394), \ - 53, \ - 341, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayColorControlServer }, /* Endpoint: 1, Cluster: Color Control (server) */ \ - { \ - 0x00000400, ZAP_ATTRIBUTE_INDEX(447), 6, 11, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Illuminance Measurement (server) */ \ - { \ - 0x00000402, ZAP_ATTRIBUTE_INDEX(453), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ - { \ - 0x00000403, ZAP_ATTRIBUTE_INDEX(458), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ - { \ - 0x00000404, ZAP_ATTRIBUTE_INDEX(462), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ - { \ - 0x00000405, ZAP_ATTRIBUTE_INDEX(467), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ - { 0x00000406, \ - ZAP_ATTRIBUTE_INDEX(472), \ - 4, \ - 5, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayOccupancySensingServer }, /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ - { 0x00000500, \ - ZAP_ATTRIBUTE_INDEX(476), \ - 6, \ - 16, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | \ - ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ - chipFuncArrayIasZoneServer }, /* Endpoint: 1, Cluster: IAS Zone (server) */ \ - { \ - 0x00000503, ZAP_ATTRIBUTE_INDEX(482), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ - { \ - 0x00000504, ZAP_ATTRIBUTE_INDEX(477), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Channel (server) */ \ - { \ - 0x00000505, ZAP_ATTRIBUTE_INDEX(479), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Target Navigator (server) */ \ - { \ - 0x00000506, ZAP_ATTRIBUTE_INDEX(489), 7, 39, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Media Playback (server) */ \ - { \ - 0x00000507, ZAP_ATTRIBUTE_INDEX(489), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Media Input (server) */ \ - { \ - 0x00000508, ZAP_ATTRIBUTE_INDEX(499), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Low Power (server) */ \ - { \ - 0x00000509, ZAP_ATTRIBUTE_INDEX(500), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Keypad Input (server) */ \ - { \ - 0x0000050A, ZAP_ATTRIBUTE_INDEX(494), 3, 260, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Content Launcher (server) */ \ - { \ - 0x0000050B, ZAP_ATTRIBUTE_INDEX(497), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Audio Output (server) */ \ - { \ - 0x0000050C, ZAP_ATTRIBUTE_INDEX(500), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Application Launcher (server) */ \ - { \ - 0x0000050D, ZAP_ATTRIBUTE_INDEX(502), 8, 138, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Application Basic (server) */ \ - { \ - 0x0000050E, ZAP_ATTRIBUTE_INDEX(517), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Account Login (server) */ \ - { \ - 0x0000050F, ZAP_ATTRIBUTE_INDEX(511), 79, 3285, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Test Cluster (server) */ \ - { \ - 0x00000B04, ZAP_ATTRIBUTE_INDEX(599), 12, 28, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ - { 0x00000004, \ - ZAP_ATTRIBUTE_INDEX(611), \ - 2, \ - 3, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayGroupsServer }, /* Endpoint: 2, Cluster: Groups (server) */ \ - { 0x00000006, \ - ZAP_ATTRIBUTE_INDEX(613), \ - 7, \ - 13, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/Off (server) */ \ - { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(620), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 2, Cluster: Descriptor (server) */ \ - { 0x00000406, \ - ZAP_ATTRIBUTE_INDEX(625), \ - 4, \ - 5, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayOccupancySensingServer }, /* Endpoint: 2, Cluster: Occupancy Sensing (server) */ \ - } + +// clang-format off +#define GENERATED_CLUSTERS { \ + { \ + /* Endpoint: 0, Cluster: Identify (server) */ \ + .clusterId = 0x00000003, \ + .attributes = ZAP_ATTRIBUTE_INDEX(0), \ + .attributeCount = 3, \ + .clusterSize = 5, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayIdentifyServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 0 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 4 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Groups (server) */ \ + .clusterId = 0x00000004, \ + .attributes = ZAP_ATTRIBUTE_INDEX(3), \ + .attributeCount = 2, \ + .clusterSize = 3, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayGroupsServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 6 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 13 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Descriptor (server) */ \ + .clusterId = 0x0000001D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(5), \ + .attributeCount = 5, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Binding (server) */ \ + .clusterId = 0x0000001E, \ + .attributes = ZAP_ATTRIBUTE_INDEX(10), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 18 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Access Control (server) */ \ + .clusterId = 0x0000001F, \ + .attributes = ZAP_ATTRIBUTE_INDEX(11), \ + .attributeCount = 3, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Basic (server) */ \ + .clusterId = 0x00000028, \ + .attributes = ZAP_ATTRIBUTE_INDEX(14), \ + .attributeCount = 20, \ + .clusterSize = 39, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayBasicServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: OTA Software Update Provider (client) */ \ + .clusterId = 0x00000029, \ + .attributes = ZAP_ATTRIBUTE_INDEX(34), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 21 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 25 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */ \ + .clusterId = 0x0000002A, \ + .attributes = ZAP_ATTRIBUTE_INDEX(35), \ + .attributeCount = 5, \ + .clusterSize = 5, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 28 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ + .clusterId = 0x0000002B, \ + .attributes = ZAP_ATTRIBUTE_INDEX(40), \ + .attributeCount = 3, \ + .clusterSize = 292, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayLocalizationConfigurationServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ + .clusterId = 0x0000002C, \ + .attributes = ZAP_ATTRIBUTE_INDEX(43), \ + .attributeCount = 4, \ + .clusterSize = 4, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayTimeFormatLocalizationServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Unit Localization (server) */ \ + .clusterId = 0x0000002D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(47), \ + .attributeCount = 3, \ + .clusterSize = 7, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Power Source Configuration (server) */ \ + .clusterId = 0x0000002E, \ + .attributes = ZAP_ATTRIBUTE_INDEX(50), \ + .attributeCount = 2, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: General Commissioning (server) */ \ + .clusterId = 0x00000030, \ + .attributes = ZAP_ATTRIBUTE_INDEX(52), \ + .attributeCount = 6, \ + .clusterSize = 270, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 30 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 35 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ + .clusterId = 0x00000031, \ + .attributes = ZAP_ATTRIBUTE_INDEX(58), \ + .attributeCount = 10, \ + .clusterSize = 60, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 38 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 46 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ + .clusterId = 0x00000032, \ + .attributes = ZAP_ATTRIBUTE_INDEX(68), \ + .attributeCount = 0, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 49 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ + .clusterId = 0x00000033, \ + .attributes = ZAP_ATTRIBUTE_INDEX(68), \ + .attributeCount = 9, \ + .clusterSize = 17, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ + .clusterId = 0x00000034, \ + .attributes = ZAP_ATTRIBUTE_INDEX(77), \ + .attributeCount = 6, \ + .clusterSize = 30, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 51 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ + .clusterId = 0x00000035, \ + .attributes = ZAP_ATTRIBUTE_INDEX(83), \ + .attributeCount = 65, \ + .clusterSize = 247, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 53 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ + .clusterId = 0x00000036, \ + .attributes = ZAP_ATTRIBUTE_INDEX(148), \ + .attributeCount = 15, \ + .clusterSize = 58, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 55 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ + .clusterId = 0x00000037, \ + .attributes = ZAP_ATTRIBUTE_INDEX(163), \ + .attributeCount = 11, \ + .clusterSize = 57, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 57 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ + .clusterId = 0x0000003C, \ + .attributes = ZAP_ATTRIBUTE_INDEX(174), \ + .attributeCount = 4, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 59 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ + .clusterId = 0x0000003E, \ + .attributes = ZAP_ATTRIBUTE_INDEX(178), \ + .attributeCount = 7, \ + .clusterSize = 4, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 63 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 73 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Group Key Management (server) */ \ + .clusterId = 0x0000003F, \ + .attributes = ZAP_ATTRIBUTE_INDEX(185), \ + .attributeCount = 5, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 78 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 83 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Fixed Label (server) */ \ + .clusterId = 0x00000040, \ + .attributes = ZAP_ATTRIBUTE_INDEX(190), \ + .attributeCount = 2, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: User Label (server) */ \ + .clusterId = 0x00000041, \ + .attributes = ZAP_ATTRIBUTE_INDEX(192), \ + .attributeCount = 2, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ + .clusterId = 0x00000405, \ + .attributes = ZAP_ATTRIBUTE_INDEX(194), \ + .attributeCount = 4, \ + .clusterSize = 8, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Identify (server) */ \ + .clusterId = 0x00000003, \ + .attributes = ZAP_ATTRIBUTE_INDEX(198), \ + .attributeCount = 3, \ + .clusterSize = 5, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayIdentifyServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 86 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 90 ) ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Groups (server) */ \ + .clusterId = 0x00000004, \ + .attributes = ZAP_ATTRIBUTE_INDEX(201), \ + .attributeCount = 2, \ + .clusterSize = 3, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayGroupsServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 92 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 99 ) ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Scenes (server) */ \ + .clusterId = 0x00000005, \ + .attributes = ZAP_ATTRIBUTE_INDEX(203), \ + .attributeCount = 6, \ + .clusterSize = 8, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayScenesServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 104 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 112 ) ,\ + },\ + { \ + /* Endpoint: 1, Cluster: On/Off (server) */ \ + .clusterId = 0x00000006, \ + .attributes = ZAP_ATTRIBUTE_INDEX(209), \ + .attributeCount = 7, \ + .clusterSize = 13, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayOnOffServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 119 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: On/off Switch Configuration (server) */ \ + .clusterId = 0x00000007, \ + .attributes = ZAP_ATTRIBUTE_INDEX(216), \ + .attributeCount = 3, \ + .clusterSize = 4, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Level Control (server) */ \ + .clusterId = 0x00000008, \ + .attributes = ZAP_ATTRIBUTE_INDEX(219), \ + .attributeCount = 16, \ + .clusterSize = 27, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayLevelControlServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 126 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Binary Input (Basic) (server) */ \ + .clusterId = 0x0000000F, \ + .attributes = ZAP_ATTRIBUTE_INDEX(235), \ + .attributeCount = 4, \ + .clusterSize = 5, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Descriptor (server) */ \ + .clusterId = 0x0000001D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(239), \ + .attributeCount = 5, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Binding (server) */ \ + .clusterId = 0x0000001E, \ + .attributes = ZAP_ATTRIBUTE_INDEX(244), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 135 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Bridged Actions (server) */ \ + .clusterId = 0x00000025, \ + .attributes = ZAP_ATTRIBUTE_INDEX(245), \ + .attributeCount = 4, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Power Source (server) */ \ + .clusterId = 0x0000002F, \ + .attributes = ZAP_ATTRIBUTE_INDEX(249), \ + .attributeCount = 11, \ + .clusterSize = 88, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Network Commissioning (server) */ \ + .clusterId = 0x00000031, \ + .attributes = ZAP_ATTRIBUTE_INDEX(260), \ + .attributeCount = 10, \ + .clusterSize = 60, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 138 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 145 ) ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Bridged Device Basic (server) */ \ + .clusterId = 0x00000039, \ + .attributes = ZAP_ATTRIBUTE_INDEX(270), \ + .attributeCount = 16, \ + .clusterSize = 679, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Switch (server) */ \ + .clusterId = 0x0000003B, \ + .attributes = ZAP_ATTRIBUTE_INDEX(286), \ + .attributeCount = 5, \ + .clusterSize = 9, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Fixed Label (server) */ \ + .clusterId = 0x00000040, \ + .attributes = ZAP_ATTRIBUTE_INDEX(291), \ + .attributeCount = 2, \ + .clusterSize = 256, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: User Label (server) */ \ + .clusterId = 0x00000041, \ + .attributes = ZAP_ATTRIBUTE_INDEX(293), \ + .attributeCount = 2, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Boolean State (server) */ \ + .clusterId = 0x00000045, \ + .attributes = ZAP_ATTRIBUTE_INDEX(295), \ + .attributeCount = 2, \ + .clusterSize = 3, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Mode Select (server) */ \ + .clusterId = 0x00000050, \ + .attributes = ZAP_ATTRIBUTE_INDEX(297), \ + .attributeCount = 6, \ + .clusterSize = 38, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 148 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Door Lock (server) */ \ + .clusterId = 0x00000101, \ + .attributes = ZAP_ATTRIBUTE_INDEX(303), \ + .attributeCount = 32, \ + .clusterSize = 54, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayDoorLockServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 150 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Window Covering (server) */ \ + .clusterId = 0x00000102, \ + .attributes = ZAP_ATTRIBUTE_INDEX(335), \ + .attributeCount = 20, \ + .clusterSize = 35, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 159 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Barrier Control (server) */ \ + .clusterId = 0x00000103, \ + .attributes = ZAP_ATTRIBUTE_INDEX(355), \ + .attributeCount = 5, \ + .clusterSize = 7, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 163 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ + .clusterId = 0x00000200, \ + .attributes = ZAP_ATTRIBUTE_INDEX(360), \ + .attributeCount = 26, \ + .clusterSize = 54, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayPumpConfigurationAndControlServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Thermostat (server) */ \ + .clusterId = 0x00000201, \ + .attributes = ZAP_ATTRIBUTE_INDEX(386), \ + .attributeCount = 19, \ + .clusterSize = 34, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayThermostatServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 166 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ + .clusterId = 0x00000204, \ + .attributes = ZAP_ATTRIBUTE_INDEX(405), \ + .attributeCount = 4, \ + .clusterSize = 5, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayThermostatUserInterfaceConfigurationServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Color Control (server) */ \ + .clusterId = 0x00000300, \ + .attributes = ZAP_ATTRIBUTE_INDEX(409), \ + .attributeCount = 53, \ + .clusterSize = 341, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayColorControlServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 170 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Illuminance Measurement (server) */ \ + .clusterId = 0x00000400, \ + .attributes = ZAP_ATTRIBUTE_INDEX(462), \ + .attributeCount = 6, \ + .clusterSize = 11, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ + .clusterId = 0x00000402, \ + .attributes = ZAP_ATTRIBUTE_INDEX(468), \ + .attributeCount = 5, \ + .clusterSize = 10, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ + .clusterId = 0x00000403, \ + .attributes = ZAP_ATTRIBUTE_INDEX(473), \ + .attributeCount = 4, \ + .clusterSize = 8, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ + .clusterId = 0x00000404, \ + .attributes = ZAP_ATTRIBUTE_INDEX(477), \ + .attributeCount = 5, \ + .clusterSize = 10, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ + .clusterId = 0x00000405, \ + .attributes = ZAP_ATTRIBUTE_INDEX(482), \ + .attributeCount = 5, \ + .clusterSize = 10, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ + .clusterId = 0x00000406, \ + .attributes = ZAP_ATTRIBUTE_INDEX(487), \ + .attributeCount = 4, \ + .clusterSize = 5, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayOccupancySensingServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: IAS Zone (server) */ \ + .clusterId = 0x00000500, \ + .attributes = ZAP_ATTRIBUTE_INDEX(491), \ + .attributeCount = 6, \ + .clusterSize = 16, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ + .functions = chipFuncArrayIasZoneServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 190 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 192 ) ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ + .clusterId = 0x00000503, \ + .attributes = ZAP_ATTRIBUTE_INDEX(497), \ + .attributeCount = 2, \ + .clusterSize = 35, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Channel (server) */ \ + .clusterId = 0x00000504, \ + .attributes = ZAP_ATTRIBUTE_INDEX(499), \ + .attributeCount = 2, \ + .clusterSize = 256, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 195 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Target Navigator (server) */ \ + .clusterId = 0x00000505, \ + .attributes = ZAP_ATTRIBUTE_INDEX(501), \ + .attributeCount = 3, \ + .clusterSize = 257, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 198 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Media Playback (server) */ \ + .clusterId = 0x00000506, \ + .attributes = ZAP_ATTRIBUTE_INDEX(504), \ + .attributeCount = 7, \ + .clusterSize = 39, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 200 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Media Input (server) */ \ + .clusterId = 0x00000507, \ + .attributes = ZAP_ATTRIBUTE_INDEX(511), \ + .attributeCount = 3, \ + .clusterSize = 257, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 211 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Low Power (server) */ \ + .clusterId = 0x00000508, \ + .attributes = ZAP_ATTRIBUTE_INDEX(514), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 216 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Keypad Input (server) */ \ + .clusterId = 0x00000509, \ + .attributes = ZAP_ATTRIBUTE_INDEX(515), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 218 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Content Launcher (server) */ \ + .clusterId = 0x0000050A, \ + .attributes = ZAP_ATTRIBUTE_INDEX(516), \ + .attributeCount = 3, \ + .clusterSize = 260, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 220 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Audio Output (server) */ \ + .clusterId = 0x0000050B, \ + .attributes = ZAP_ATTRIBUTE_INDEX(519), \ + .attributeCount = 3, \ + .clusterSize = 257, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 223 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Application Launcher (server) */ \ + .clusterId = 0x0000050C, \ + .attributes = ZAP_ATTRIBUTE_INDEX(522), \ + .attributeCount = 2, \ + .clusterSize = 256, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 226 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Application Basic (server) */ \ + .clusterId = 0x0000050D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(524), \ + .attributeCount = 8, \ + .clusterSize = 138, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Account Login (server) */ \ + .clusterId = 0x0000050E, \ + .attributes = ZAP_ATTRIBUTE_INDEX(532), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 228 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Test Cluster (server) */ \ + .clusterId = 0x0000050F, \ + .attributes = ZAP_ATTRIBUTE_INDEX(533), \ + .attributeCount = 81, \ + .clusterSize = 3285, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 230 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 249 ) ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ + .clusterId = 0x00000B04, \ + .attributes = ZAP_ATTRIBUTE_INDEX(614), \ + .attributeCount = 12, \ + .clusterSize = 28, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 2, Cluster: Groups (server) */ \ + .clusterId = 0x00000004, \ + .attributes = ZAP_ATTRIBUTE_INDEX(626), \ + .attributeCount = 2, \ + .clusterSize = 3, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayGroupsServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 258 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 265 ) ,\ + },\ + { \ + /* Endpoint: 2, Cluster: On/Off (server) */ \ + .clusterId = 0x00000006, \ + .attributes = ZAP_ATTRIBUTE_INDEX(628), \ + .attributeCount = 7, \ + .clusterSize = 13, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayOnOffServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 270 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 2, Cluster: Descriptor (server) */ \ + .clusterId = 0x0000001D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(635), \ + .attributeCount = 5, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 2, Cluster: Occupancy Sensing (server) */ \ + .clusterId = 0x00000406, \ + .attributes = ZAP_ATTRIBUTE_INDEX(640), \ + .attributeCount = 4, \ + .clusterSize = 5, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayOccupancySensingServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ +} + +// clang-format on #define ZAP_CLUSTER_INDEX(index) (&generatedClusters[index]) @@ -3188,7 +3740,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 25, 1761 }, { ZAP_CLUSTER_INDEX(25), 46, 6194 }, { ZAP_CLUSTER_INDEX(71), 4, 21 }, \ + { ZAP_CLUSTER_INDEX(0), 26, 1120 }, { ZAP_CLUSTER_INDEX(26), 46, 6876 }, { ZAP_CLUSTER_INDEX(72), 4, 21 }, \ } // Largest attribute size is needed for various buffers @@ -3198,7 +3750,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (718) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (7976) +#define ATTRIBUTE_MAX_SIZE (8017) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (3) 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 62fafbde0bf312..c9cbbe486c5d9f 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 @@ -16527,7 +16527,12 @@ struct Type Optional groupName; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - bool MatchesFabricIndex(FabricIndex fabricIndex_) const { return fabricIndex == fabricIndex_; } + + static constexpr bool kIsFabricScoped = true; + + auto GetFabricIndex() const { return fabricIndex; } + + void SetFabricIndex(chip::FabricIndex fabricIndex_) { fabricIndex = fabricIndex_; } }; struct DecodableType @@ -16537,9 +16542,14 @@ struct DecodableType chip::GroupId groupId = static_cast(0); DataModel::DecodableList endpoints; Optional groupName; + CHIP_ERROR Decode(TLV::TLVReader & reader); - static constexpr bool kIsFabricScoped = false; + static constexpr bool kIsFabricScoped = true; + + auto GetFabricIndex() const { return fabricIndex; } + + void SetFabricIndex(chip::FabricIndex fabricIndex_) { fabricIndex = fabricIndex_; } }; } // namespace GroupInfoMapStruct diff --git a/zzz_generated/bridge-app/zap-generated/endpoint_config.h b/zzz_generated/bridge-app/zap-generated/endpoint_config.h index 91d75f381be244..80c3d57f7aec76 100644 --- a/zzz_generated/bridge-app/zap-generated/endpoint_config.h +++ b/zzz_generated/bridge-app/zap-generated/endpoint_config.h @@ -42,7 +42,7 @@ /* 10 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 38 - BasicCommissioningInfoList, */ \ + /* 18 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -58,238 +58,238 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 292 - FeatureMap, */ \ + /* 272 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x06, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), big-endian */ \ \ - /* 296 - Networks, */ \ + /* 276 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 308 - LastConnectErrorValue, */ \ + /* 288 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 312 - FeatureMap, */ \ + /* 292 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), big-endian */ \ \ - /* 316 - UpTime, */ \ + /* 296 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 324 - TotalOperationalHours, */ \ + /* 304 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), big-endian */ \ \ - /* 328 - CurrentHeapFree, */ \ + /* 308 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 336 - CurrentHeapUsed, */ \ + /* 316 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 344 - CurrentHeapHighWatermark, */ \ + /* 324 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 352 - FeatureMap, */ \ + /* 332 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), big-endian */ \ \ - /* 356 - NetworkName, */ \ + /* 336 - NetworkName, */ \ 0x00, 0x00, \ \ - /* 358 - ExtendedPanId, */ \ + /* 338 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 366 - OverrunCount, */ \ + /* 346 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 374 - PartitionId, */ \ + /* 354 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 378 - TxTotalCount, */ \ + /* 358 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 382 - TxUnicastCount, */ \ + /* 362 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 386 - TxBroadcastCount, */ \ + /* 366 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 390 - TxAckRequestedCount, */ \ + /* 370 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 394 - TxAckedCount, */ \ + /* 374 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 398 - TxNoAckRequestedCount, */ \ + /* 378 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 402 - TxDataCount, */ \ + /* 382 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 406 - TxDataPollCount, */ \ + /* 386 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 410 - TxBeaconCount, */ \ + /* 390 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 414 - TxBeaconRequestCount, */ \ + /* 394 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 418 - TxOtherCount, */ \ + /* 398 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 422 - TxRetryCount, */ \ + /* 402 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 426 - TxDirectMaxRetryExpiryCount, */ \ + /* 406 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 430 - TxIndirectMaxRetryExpiryCount, */ \ + /* 410 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 434 - TxErrCcaCount, */ \ + /* 414 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 438 - TxErrAbortCount, */ \ + /* 418 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 442 - TxErrBusyChannelCount, */ \ + /* 422 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 446 - RxTotalCount, */ \ + /* 426 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 450 - RxUnicastCount, */ \ + /* 430 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 454 - RxBroadcastCount, */ \ + /* 434 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 458 - RxDataCount, */ \ + /* 438 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 462 - RxDataPollCount, */ \ + /* 442 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 466 - RxBeaconCount, */ \ + /* 446 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 470 - RxBeaconRequestCount, */ \ + /* 450 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 474 - RxOtherCount, */ \ + /* 454 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 478 - RxAddressFilteredCount, */ \ + /* 458 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 482 - RxDestAddrFilteredCount, */ \ + /* 462 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 486 - RxDuplicatedCount, */ \ + /* 466 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 490 - RxErrNoFrameCount, */ \ + /* 470 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 494 - RxErrUnknownNeighborCount, */ \ + /* 474 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 498 - RxErrInvalidSrcAddrCount, */ \ + /* 478 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 502 - RxErrSecCount, */ \ + /* 482 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 506 - RxErrFcsCount, */ \ + /* 486 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 510 - RxErrOtherCount, */ \ + /* 490 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 514 - ActiveTimestamp, */ \ + /* 494 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 522 - PendingTimestamp, */ \ + /* 502 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 530 - delay, */ \ + /* 510 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 534 - ChannelMask, */ \ + /* 514 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 541 - FeatureMap, */ \ + /* 521 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x15, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), big-endian */ \ \ - /* 545 - BeaconLostCount, */ \ + /* 525 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 549 - BeaconRxCount, */ \ + /* 529 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 553 - PacketMulticastRxCount, */ \ + /* 533 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 557 - PacketMulticastTxCount, */ \ + /* 537 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 561 - PacketUnicastRxCount, */ \ + /* 541 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 565 - PacketUnicastTxCount, */ \ + /* 545 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 569 - CurrentMaxRate, */ \ + /* 549 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 577 - OverrunCount, */ \ + /* 557 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 585 - FeatureMap, */ \ + /* 565 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), big-endian */ \ \ - /* 589 - PacketRxCount, */ \ + /* 569 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 597 - PacketTxCount, */ \ + /* 577 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 605 - TxErrCount, */ \ + /* 585 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 613 - CollisionCount, */ \ + /* 593 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 621 - OverrunCount, */ \ + /* 601 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 629 - TimeSinceReset, */ \ + /* 609 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 637 - FeatureMap, */ \ + /* 617 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ /* Endpoint: 1, Cluster: Level Control (server), big-endian */ \ \ - /* 641 - FeatureMap, */ \ + /* 621 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ /* Endpoint: 1, Cluster: Switch (server), big-endian */ \ \ - /* 645 - FeatureMap, */ \ + /* 625 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Fixed Label (server), big-endian */ \ \ - /* 649 - label list, */ \ + /* 629 - label list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -325,7 +325,7 @@ /* 10 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 38 - BasicCommissioningInfoList, */ \ + /* 18 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -341,238 +341,238 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 292 - FeatureMap, */ \ + /* 272 - FeatureMap, */ \ 0x06, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), little-endian */ \ \ - /* 296 - Networks, */ \ + /* 276 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 308 - LastConnectErrorValue, */ \ + /* 288 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 312 - FeatureMap, */ \ + /* 292 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), little-endian */ \ \ - /* 316 - UpTime, */ \ + /* 296 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 324 - TotalOperationalHours, */ \ + /* 304 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), little-endian */ \ \ - /* 328 - CurrentHeapFree, */ \ + /* 308 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 336 - CurrentHeapUsed, */ \ + /* 316 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 344 - CurrentHeapHighWatermark, */ \ + /* 324 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 352 - FeatureMap, */ \ + /* 332 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), little-endian */ \ \ - /* 356 - NetworkName, */ \ + /* 336 - NetworkName, */ \ 0x00, 0x00, \ \ - /* 358 - ExtendedPanId, */ \ + /* 338 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 366 - OverrunCount, */ \ + /* 346 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 374 - PartitionId, */ \ + /* 354 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 378 - TxTotalCount, */ \ + /* 358 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 382 - TxUnicastCount, */ \ + /* 362 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 386 - TxBroadcastCount, */ \ + /* 366 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 390 - TxAckRequestedCount, */ \ + /* 370 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 394 - TxAckedCount, */ \ + /* 374 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 398 - TxNoAckRequestedCount, */ \ + /* 378 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 402 - TxDataCount, */ \ + /* 382 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 406 - TxDataPollCount, */ \ + /* 386 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 410 - TxBeaconCount, */ \ + /* 390 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 414 - TxBeaconRequestCount, */ \ + /* 394 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 418 - TxOtherCount, */ \ + /* 398 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 422 - TxRetryCount, */ \ + /* 402 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 426 - TxDirectMaxRetryExpiryCount, */ \ + /* 406 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 430 - TxIndirectMaxRetryExpiryCount, */ \ + /* 410 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 434 - TxErrCcaCount, */ \ + /* 414 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 438 - TxErrAbortCount, */ \ + /* 418 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 442 - TxErrBusyChannelCount, */ \ + /* 422 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 446 - RxTotalCount, */ \ + /* 426 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 450 - RxUnicastCount, */ \ + /* 430 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 454 - RxBroadcastCount, */ \ + /* 434 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 458 - RxDataCount, */ \ + /* 438 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 462 - RxDataPollCount, */ \ + /* 442 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 466 - RxBeaconCount, */ \ + /* 446 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 470 - RxBeaconRequestCount, */ \ + /* 450 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 474 - RxOtherCount, */ \ + /* 454 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 478 - RxAddressFilteredCount, */ \ + /* 458 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 482 - RxDestAddrFilteredCount, */ \ + /* 462 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 486 - RxDuplicatedCount, */ \ + /* 466 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 490 - RxErrNoFrameCount, */ \ + /* 470 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 494 - RxErrUnknownNeighborCount, */ \ + /* 474 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 498 - RxErrInvalidSrcAddrCount, */ \ + /* 478 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 502 - RxErrSecCount, */ \ + /* 482 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 506 - RxErrFcsCount, */ \ + /* 486 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 510 - RxErrOtherCount, */ \ + /* 490 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 514 - ActiveTimestamp, */ \ + /* 494 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 522 - PendingTimestamp, */ \ + /* 502 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 530 - delay, */ \ + /* 510 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 534 - ChannelMask, */ \ + /* 514 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 541 - FeatureMap, */ \ + /* 521 - FeatureMap, */ \ 0x15, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), little-endian */ \ \ - /* 545 - BeaconLostCount, */ \ + /* 525 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 549 - BeaconRxCount, */ \ + /* 529 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 553 - PacketMulticastRxCount, */ \ + /* 533 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 557 - PacketMulticastTxCount, */ \ + /* 537 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 561 - PacketUnicastRxCount, */ \ + /* 541 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 565 - PacketUnicastTxCount, */ \ + /* 545 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 569 - CurrentMaxRate, */ \ + /* 549 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 577 - OverrunCount, */ \ + /* 557 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 585 - FeatureMap, */ \ + /* 565 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), little-endian */ \ \ - /* 589 - PacketRxCount, */ \ + /* 569 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 597 - PacketTxCount, */ \ + /* 577 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 605 - TxErrCount, */ \ + /* 585 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 613 - CollisionCount, */ \ + /* 593 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 621 - OverrunCount, */ \ + /* 601 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 629 - TimeSinceReset, */ \ + /* 609 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 637 - FeatureMap, */ \ + /* 617 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Level Control (server), little-endian */ \ \ - /* 641 - FeatureMap, */ \ + /* 621 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Switch (server), little-endian */ \ \ - /* 645 - FeatureMap, */ \ + /* 625 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Fixed Label (server), little-endian */ \ \ - /* 649 - label list, */ \ + /* 629 - label list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -591,7 +591,7 @@ #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (78) +#define GENERATED_DEFAULTS_COUNT (76) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -629,12 +629,11 @@ { \ \ /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Access Control (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -709,30 +708,30 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x00000000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(30) }, /* Breadcrumb */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(38) }, /* BasicCommissioningInfoList */ \ + { 0x00000000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(10) }, /* Breadcrumb */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(18) }, /* BasicCommissioningInfoList */ \ { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* RegulatoryConfig */ \ { 0x00000003, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* LocationCapability */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(292) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(272) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* MaxNetworks */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(296) }, /* Networks */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(276) }, /* Networks */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ScanMaxTimeSeconds */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ConnectMaxTimeSeconds */ \ { 0x00000004, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* InterfaceEnabled */ \ { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkingStatus */ \ { 0x00000006, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkID */ \ - { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(308) }, /* LastConnectErrorValue */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(312) }, /* FeatureMap */ \ + { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(288) }, /* LastConnectErrorValue */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(292) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NetworkInterfaces */ \ { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* RebootCount */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(316) }, /* UpTime */ \ - { 0x00000003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(324) }, /* TotalOperationalHours */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(296) }, /* UpTime */ \ + { 0x00000003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(304) }, /* TotalOperationalHours */ \ { 0x00000004, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BootReasons */ \ { 0x00000005, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* ActiveHardwareFaults */ \ @@ -743,23 +742,23 @@ \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ThreadMetrics */ \ - { 0x00000001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(328) }, /* CurrentHeapFree */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(336) }, /* CurrentHeapUsed */ \ - { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(344) }, /* CurrentHeapHighWatermark */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(352) }, /* FeatureMap */ \ + { 0x00000001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(308) }, /* CurrentHeapFree */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(316) }, /* CurrentHeapUsed */ \ + { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(324) }, /* CurrentHeapHighWatermark */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(332) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x00000001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ - { 0x00000002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(356) }, /* NetworkName */ \ + { 0x00000002, ZAP_TYPE(CHAR_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(336) }, /* NetworkName */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ - { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(358) }, /* ExtendedPanId */ \ + { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(338) }, /* ExtendedPanId */ \ { 0x00000005, ZAP_TYPE(OCTET_STRING), 18, 0, ZAP_EMPTY_DEFAULT() }, /* MeshLocalPrefix */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(366) }, /* OverrunCount */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(346) }, /* OverrunCount */ \ { 0x00000007, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NeighborTableList */ \ { 0x00000008, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* RouteTableList */ \ - { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(374) }, /* PartitionId */ \ + { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(354) }, /* PartitionId */ \ { 0x0000000A, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* weighting */ \ { 0x0000000B, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* DataVersion */ \ { 0x0000000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* StableDataVersion */ \ @@ -772,50 +771,50 @@ { 0x00000013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PartitionIdChangeCount */ \ { 0x00000014, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* BetterPartitionAttachAttemptCount */ \ { 0x00000015, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ParentChangeCount */ \ - { 0x00000016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(378) }, /* TxTotalCount */ \ - { 0x00000017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(382) }, /* TxUnicastCount */ \ - { 0x00000018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(386) }, /* TxBroadcastCount */ \ - { 0x00000019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(390) }, /* TxAckRequestedCount */ \ - { 0x0000001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(394) }, /* TxAckedCount */ \ - { 0x0000001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(398) }, /* TxNoAckRequestedCount */ \ - { 0x0000001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(402) }, /* TxDataCount */ \ - { 0x0000001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(406) }, /* TxDataPollCount */ \ - { 0x0000001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(410) }, /* TxBeaconCount */ \ - { 0x0000001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(414) }, /* TxBeaconRequestCount */ \ - { 0x00000020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(418) }, /* TxOtherCount */ \ - { 0x00000021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(422) }, /* TxRetryCount */ \ - { 0x00000022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(426) }, /* TxDirectMaxRetryExpiryCount */ \ - { 0x00000023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(430) }, /* TxIndirectMaxRetryExpiryCount */ \ - { 0x00000024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(434) }, /* TxErrCcaCount */ \ - { 0x00000025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(438) }, /* TxErrAbortCount */ \ - { 0x00000026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(442) }, /* TxErrBusyChannelCount */ \ - { 0x00000027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(446) }, /* RxTotalCount */ \ - { 0x00000028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(450) }, /* RxUnicastCount */ \ - { 0x00000029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(454) }, /* RxBroadcastCount */ \ - { 0x0000002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(458) }, /* RxDataCount */ \ - { 0x0000002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(462) }, /* RxDataPollCount */ \ - { 0x0000002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(466) }, /* RxBeaconCount */ \ - { 0x0000002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(470) }, /* RxBeaconRequestCount */ \ - { 0x0000002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(474) }, /* RxOtherCount */ \ - { 0x0000002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(478) }, /* RxAddressFilteredCount */ \ - { 0x00000030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(482) }, /* RxDestAddrFilteredCount */ \ - { 0x00000031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(486) }, /* RxDuplicatedCount */ \ - { 0x00000032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(490) }, /* RxErrNoFrameCount */ \ - { 0x00000033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(494) }, /* RxErrUnknownNeighborCount */ \ - { 0x00000034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(498) }, /* RxErrInvalidSrcAddrCount */ \ - { 0x00000035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(502) }, /* RxErrSecCount */ \ - { 0x00000036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(506) }, /* RxErrFcsCount */ \ - { 0x00000037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(510) }, /* RxErrOtherCount */ \ - { 0x00000038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(514) }, /* ActiveTimestamp */ \ - { 0x00000039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(522) }, /* PendingTimestamp */ \ - { 0x0000003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(530) }, /* delay */ \ + { 0x00000016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(358) }, /* TxTotalCount */ \ + { 0x00000017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(362) }, /* TxUnicastCount */ \ + { 0x00000018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(366) }, /* TxBroadcastCount */ \ + { 0x00000019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(370) }, /* TxAckRequestedCount */ \ + { 0x0000001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(374) }, /* TxAckedCount */ \ + { 0x0000001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(378) }, /* TxNoAckRequestedCount */ \ + { 0x0000001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(382) }, /* TxDataCount */ \ + { 0x0000001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(386) }, /* TxDataPollCount */ \ + { 0x0000001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(390) }, /* TxBeaconCount */ \ + { 0x0000001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(394) }, /* TxBeaconRequestCount */ \ + { 0x00000020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(398) }, /* TxOtherCount */ \ + { 0x00000021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(402) }, /* TxRetryCount */ \ + { 0x00000022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(406) }, /* TxDirectMaxRetryExpiryCount */ \ + { 0x00000023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(410) }, /* TxIndirectMaxRetryExpiryCount */ \ + { 0x00000024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(414) }, /* TxErrCcaCount */ \ + { 0x00000025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(418) }, /* TxErrAbortCount */ \ + { 0x00000026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(422) }, /* TxErrBusyChannelCount */ \ + { 0x00000027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(426) }, /* RxTotalCount */ \ + { 0x00000028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(430) }, /* RxUnicastCount */ \ + { 0x00000029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(434) }, /* RxBroadcastCount */ \ + { 0x0000002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(438) }, /* RxDataCount */ \ + { 0x0000002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(442) }, /* RxDataPollCount */ \ + { 0x0000002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(446) }, /* RxBeaconCount */ \ + { 0x0000002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(450) }, /* RxBeaconRequestCount */ \ + { 0x0000002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(454) }, /* RxOtherCount */ \ + { 0x0000002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(458) }, /* RxAddressFilteredCount */ \ + { 0x00000030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(462) }, /* RxDestAddrFilteredCount */ \ + { 0x00000031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(466) }, /* RxDuplicatedCount */ \ + { 0x00000032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(470) }, /* RxErrNoFrameCount */ \ + { 0x00000033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(474) }, /* RxErrUnknownNeighborCount */ \ + { 0x00000034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(478) }, /* RxErrInvalidSrcAddrCount */ \ + { 0x00000035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(482) }, /* RxErrSecCount */ \ + { 0x00000036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(486) }, /* RxErrFcsCount */ \ + { 0x00000037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(490) }, /* RxErrOtherCount */ \ + { 0x00000038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(494) }, /* ActiveTimestamp */ \ + { 0x00000039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(502) }, /* PendingTimestamp */ \ + { 0x0000003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(510) }, /* delay */ \ { 0x0000003B, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SecurityPolicy */ \ - { 0x0000003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(534) }, /* ChannelMask */ \ + { 0x0000003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(514) }, /* ChannelMask */ \ { 0x0000003D, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* OperationalDatasetComponents */ \ { 0x0000003E, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* ActiveNetworkFaultsList */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(541) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(521) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ @@ -824,36 +823,36 @@ { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* WiFiVersion */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChannelNumber */ \ { 0x00000004, ZAP_TYPE(INT8S), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Rssi */ \ - { 0x00000005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(545) }, /* BeaconLostCount */ \ - { 0x00000006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(549) }, /* BeaconRxCount */ \ - { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(553) }, /* PacketMulticastRxCount */ \ - { 0x00000008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(557) }, /* PacketMulticastTxCount */ \ - { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(561) }, /* PacketUnicastRxCount */ \ - { 0x0000000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(565) }, /* PacketUnicastTxCount */ \ - { 0x0000000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(569) }, /* CurrentMaxRate */ \ - { 0x0000000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(577) }, /* OverrunCount */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(585) }, /* FeatureMap */ \ + { 0x00000005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(525) }, /* BeaconLostCount */ \ + { 0x00000006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(529) }, /* BeaconRxCount */ \ + { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(533) }, /* PacketMulticastRxCount */ \ + { 0x00000008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(537) }, /* PacketMulticastTxCount */ \ + { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(541) }, /* PacketUnicastRxCount */ \ + { 0x0000000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(545) }, /* PacketUnicastTxCount */ \ + { 0x0000000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(549) }, /* CurrentMaxRate */ \ + { 0x0000000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(557) }, /* OverrunCount */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(565) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* PHYRate */ \ { 0x00000001, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* FullDuplex */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(589) }, /* PacketRxCount */ \ - { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(597) }, /* PacketTxCount */ \ - { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(605) }, /* TxErrCount */ \ - { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(613) }, /* CollisionCount */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(621) }, /* OverrunCount */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(569) }, /* PacketRxCount */ \ + { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(577) }, /* PacketTxCount */ \ + { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(585) }, /* TxErrCount */ \ + { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(593) }, /* CollisionCount */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(601) }, /* OverrunCount */ \ { 0x00000007, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* CarrierDetect */ \ - { 0x00000008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(629) }, /* TimeSinceReset */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(637) }, /* FeatureMap */ \ + { 0x00000008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(609) }, /* TimeSinceReset */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(617) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { 0x00000000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* WindowStatus */ \ + { 0x00000000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ { 0x00000001, ZAP_TYPE(FABRIC_IDX), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* AdminVendorId */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ @@ -902,26 +901,25 @@ { 0x00004000, ZAP_TYPE(INT8U), 1, \ ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(255) }, /* start up current level */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(641) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(621) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Switch (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(2) }, /* number of positions */ \ { 0x00000001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(1) }, /* current position */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(2) }, /* multi press max */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(645) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(625) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Fixed Label (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(649) }, /* label list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(629) }, /* label list */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ } @@ -1034,93 +1032,254 @@ #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask #define GENERATED_CLUSTER_COUNT 22 -#define GENERATED_CLUSTERS \ - { \ - { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(0), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { 0x00000028, \ - ZAP_ATTRIBUTE_INDEX(5), \ - 20, \ - 39, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayBasicServer }, /* Endpoint: 0, Cluster: Basic (server) */ \ - { 0x0000002B, \ - ZAP_ATTRIBUTE_INDEX(25), \ - 3, \ - 38, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayLocalizationConfigurationServer }, /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ - { 0x0000002C, \ - ZAP_ATTRIBUTE_INDEX(28), \ - 4, \ - 4, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayTimeFormatLocalizationServer }, /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ - { 0x0000002D, \ - ZAP_ATTRIBUTE_INDEX(32), \ - 3, \ - 7, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayUnitLocalizationServer }, /* Endpoint: 0, Cluster: Unit Localization (server) */ \ - { \ - 0x00000030, ZAP_ATTRIBUTE_INDEX(32), 6, 270, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { \ - 0x00000031, ZAP_ATTRIBUTE_INDEX(38), 10, 60, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { \ - 0x00000032, ZAP_ATTRIBUTE_INDEX(51), 0, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ - { \ - 0x00000033, ZAP_ATTRIBUTE_INDEX(51), 9, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ - { \ - 0x00000034, ZAP_ATTRIBUTE_INDEX(60), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { \ - 0x00000035, ZAP_ATTRIBUTE_INDEX(66), 65, 247, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { \ - 0x00000036, ZAP_ATTRIBUTE_INDEX(131), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ - { \ - 0x00000037, ZAP_ATTRIBUTE_INDEX(146), 11, 57, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ - { \ - 0x0000003C, ZAP_ATTRIBUTE_INDEX(157), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(161), 7, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(168), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ - { \ - 0x00000041, ZAP_ATTRIBUTE_INDEX(170), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: User Label (server) */ \ - { 0x00000006, \ - ZAP_ATTRIBUTE_INDEX(172), \ - 2, \ - 3, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ - { 0x00000008, \ - ZAP_ATTRIBUTE_INDEX(174), \ - 16, \ - 27, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ - { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(190), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ - { \ - 0x0000003B, ZAP_ATTRIBUTE_INDEX(195), 5, 9, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Switch (server) */ \ - { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(197), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Fixed Label (server) */ \ - } + +// clang-format off +#define GENERATED_CLUSTERS { \ + { \ + /* Endpoint: 0, Cluster: Descriptor (server) */ \ + .clusterId = 0x0000001D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(0), \ + .attributeCount = 5, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Basic (server) */ \ + .clusterId = 0x00000028, \ + .attributes = ZAP_ATTRIBUTE_INDEX(5), \ + .attributeCount = 20, \ + .clusterSize = 39, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayBasicServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ + .clusterId = 0x0000002B, \ + .attributes = ZAP_ATTRIBUTE_INDEX(25), \ + .attributeCount = 3, \ + .clusterSize = 38, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayLocalizationConfigurationServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ + .clusterId = 0x0000002C, \ + .attributes = ZAP_ATTRIBUTE_INDEX(28), \ + .attributeCount = 4, \ + .clusterSize = 4, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayTimeFormatLocalizationServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Unit Localization (server) */ \ + .clusterId = 0x0000002D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(32), \ + .attributeCount = 3, \ + .clusterSize = 7, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: General Commissioning (server) */ \ + .clusterId = 0x00000030, \ + .attributes = ZAP_ATTRIBUTE_INDEX(35), \ + .attributeCount = 6, \ + .clusterSize = 270, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 0 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 4 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ + .clusterId = 0x00000031, \ + .attributes = ZAP_ATTRIBUTE_INDEX(41), \ + .attributeCount = 10, \ + .clusterSize = 60, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 7 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 14 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ + .clusterId = 0x00000032, \ + .attributes = ZAP_ATTRIBUTE_INDEX(51), \ + .attributeCount = 0, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 17 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ + .clusterId = 0x00000033, \ + .attributes = ZAP_ATTRIBUTE_INDEX(51), \ + .attributeCount = 9, \ + .clusterSize = 17, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ + .clusterId = 0x00000034, \ + .attributes = ZAP_ATTRIBUTE_INDEX(60), \ + .attributeCount = 6, \ + .clusterSize = 30, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 19 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ + .clusterId = 0x00000035, \ + .attributes = ZAP_ATTRIBUTE_INDEX(66), \ + .attributeCount = 65, \ + .clusterSize = 247, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ + .clusterId = 0x00000036, \ + .attributes = ZAP_ATTRIBUTE_INDEX(131), \ + .attributeCount = 15, \ + .clusterSize = 58, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ + .clusterId = 0x00000037, \ + .attributes = ZAP_ATTRIBUTE_INDEX(146), \ + .attributeCount = 11, \ + .clusterSize = 57, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 21 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ + .clusterId = 0x0000003C, \ + .attributes = ZAP_ATTRIBUTE_INDEX(157), \ + .attributeCount = 4, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 23 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ + .clusterId = 0x0000003E, \ + .attributes = ZAP_ATTRIBUTE_INDEX(161), \ + .attributeCount = 7, \ + .clusterSize = 4, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 27 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 37 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Fixed Label (server) */ \ + .clusterId = 0x00000040, \ + .attributes = ZAP_ATTRIBUTE_INDEX(168), \ + .attributeCount = 2, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: User Label (server) */ \ + .clusterId = 0x00000041, \ + .attributes = ZAP_ATTRIBUTE_INDEX(170), \ + .attributeCount = 2, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: On/Off (server) */ \ + .clusterId = 0x00000006, \ + .attributes = ZAP_ATTRIBUTE_INDEX(172), \ + .attributeCount = 2, \ + .clusterSize = 3, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayOnOffServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 42 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Level Control (server) */ \ + .clusterId = 0x00000008, \ + .attributes = ZAP_ATTRIBUTE_INDEX(174), \ + .attributeCount = 16, \ + .clusterSize = 27, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayLevelControlServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 46 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Descriptor (server) */ \ + .clusterId = 0x0000001D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(190), \ + .attributeCount = 5, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Switch (server) */ \ + .clusterId = 0x0000003B, \ + .attributes = ZAP_ATTRIBUTE_INDEX(195), \ + .attributeCount = 5, \ + .clusterSize = 9, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Fixed Label (server) */ \ + .clusterId = 0x00000040, \ + .attributes = ZAP_ATTRIBUTE_INDEX(200), \ + .attributeCount = 2, \ + .clusterSize = 256, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ +} + +// clang-format on #define ZAP_CLUSTER_INDEX(index) (&generatedClusters[index]) @@ -1129,7 +1288,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 16, 1478 }, { ZAP_CLUSTER_INDEX(16), 5, 295 }, \ + { ZAP_CLUSTER_INDEX(0), 17, 837 }, { ZAP_CLUSTER_INDEX(17), 5, 295 }, \ } // Largest attribute size is needed for various buffers @@ -1139,7 +1298,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (39) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (1773) +#define ATTRIBUTE_MAX_SIZE (1132) // 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 75246df7e03b2e..210b1742d7555d 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -26,52138 +26,8 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Value logging functions. The non-generated ones depend on the -// generated ones, so are placed here. -namespace { - -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::detail::Structs::LabelStruct::DecodableType & value); - -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::Scenes::Structs::SceneExtensionFieldSet::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::PowerProfile::Structs::PowerProfileRecord::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::PowerProfile::Structs::ScheduledPhase::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::PowerProfile::Structs::TransferredPhase::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::Descriptor::Structs::DeviceType::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::AccessControl::Structs::Target::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::AccessControl::Structs::AccessControlEntry::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::AccessControl::Structs::ExtensionEntry::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::BridgedActions::Structs::ActionStruct::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::BridgedActions::Structs::EndpointListStruct::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::OtaSoftwareUpdateRequestor::Structs::ProviderLocation::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::GeneralCommissioning::Structs::BasicCommissioningInfoType::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::NetworkCommissioning::Structs::NetworkInfo::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::NetworkCommissioning::Structs::ThreadInterfaceScanResult::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::NetworkCommissioning::Structs::WiFiInterfaceScanResult::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::GeneralDiagnostics::Structs::NetworkInterfaceType::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::SoftwareDiagnostics::Structs::SoftwareFault::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::SoftwareDiagnostics::Structs::ThreadMetrics::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ThreadNetworkDiagnostics::Structs::NeighborTable::DecodableType & value); -CHIP_ERROR -LogValue(const char * label, size_t indent, - const chip::app::Clusters::ThreadNetworkDiagnostics::Structs::OperationalDatasetComponents::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ThreadNetworkDiagnostics::Structs::RouteTable::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ThreadNetworkDiagnostics::Structs::SecurityPolicy::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::OperationalCredentials::Structs::NOCStruct::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::GroupKeyManagement::Structs::GroupInfoMapStruct::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ModeSelect::Structs::ModeOptionStruct::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ModeSelect::Structs::SemanticTag::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::DoorLock::Structs::DlCredential::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::IasAce::Structs::IasAceZoneStatusResult::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::Channel::Structs::ChannelInfo::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::Channel::Structs::LineupInfo::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::TargetNavigator::Structs::TargetInfo::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::MediaPlayback::Structs::PlaybackPosition::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::MediaInput::Structs::InputInfo::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ContentLauncher::Structs::Dimension::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ContentLauncher::Structs::AdditionalInfo::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ContentLauncher::Structs::Parameter::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ContentLauncher::Structs::ContentSearch::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ContentLauncher::Structs::StyleInformation::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ContentLauncher::Structs::BrandingInformation::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::AudioOutput::Structs::OutputInfo::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationLauncherApplication::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::TestCluster::Structs::SimpleStruct::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::TestCluster::Structs::NullablesAndOptionalsStruct::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::TestCluster::Structs::NestedStruct::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::TestCluster::Structs::NestedStructList::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::TestCluster::Structs::DoubleNestedStructList::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::TestCluster::Structs::TestFabricScoped::DecodableType & value); -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::TestCluster::Structs::TestListStructOctet::DecodableType & value); - -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::AccessControl::Events::AccessControlEntryChanged::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::AccessControl::Events::AccessControlExtensionChanged::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::BridgedActions::Events::StateChanged::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::BridgedActions::Events::ActionFailed::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::Basic::Events::StartUp::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::Basic::Events::ShutDown::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::Basic::Events::Leave::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::Basic::Events::ReachableChanged::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::OtaSoftwareUpdateRequestor::Events::StateTransition::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::OtaSoftwareUpdateRequestor::Events::VersionApplied::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::OtaSoftwareUpdateRequestor::Events::DownloadError::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::GeneralDiagnostics::Events::HardwareFaultChange::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::GeneralDiagnostics::Events::RadioFaultChange::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::GeneralDiagnostics::Events::NetworkFaultChange::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::GeneralDiagnostics::Events::BootReason::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::SoftwareDiagnostics::Events::SoftwareFault::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::ThreadNetworkDiagnostics::Events::ConnectionStatus::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::WiFiNetworkDiagnostics::Events::Disconnection::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::WiFiNetworkDiagnostics::Events::AssociationFailure::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::WiFiNetworkDiagnostics::Events::ConnectionStatus::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::Switch::Events::SwitchLatched::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::Switch::Events::InitialPress::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::Switch::Events::LongPress::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::Switch::Events::ShortRelease::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::Switch::Events::LongRelease::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::Switch::Events::MultiPressOngoing::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::Switch::Events::MultiPressComplete::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::BooleanState::Events::StateChange::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::DoorLock::Events::DoorLockAlarm::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::DoorLock::Events::DoorStateChange::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::DoorLock::Events::LockOperation::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::DoorLock::Events::LockOperationError::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::DoorLock::Events::LockUserChange::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::SupplyVoltageLow::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::SupplyVoltageHigh::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::PowerMissingPhase::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::SystemPressureLow::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::SystemPressureHigh::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::DryRunning::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::MotorTemperatureHigh::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::PumpMotorFatalFailure::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::ElectronicTemperatureHigh::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::PumpBlocked::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::SensorFailure::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::ElectronicNonFatalFailure::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::ElectronicFatalFailure::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::GeneralFault::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::Leakage::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::AirDetection::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::TurbineOperation::DecodableType value); -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::TestCluster::Events::TestEvent::DecodableType value); - -#if CHIP_PROGRESS_LOGGING -std::string IndentStr(size_t indent) -{ - std::string str; - for (size_t i = 0; i < indent; ++i) - { - str.append(" "); - } - return str; -} -#endif // CHIP_PROGRESS_LOGGING - -template ::value && !std::is_same>, bool>::value, int> = 0> -CHIP_ERROR LogValue(const char * label, size_t indent, X value) -{ - ChipLogProgress(chipTool, "%s%s: %s", IndentStr(indent).c_str(), label, std::to_string(value).c_str()); - return CHIP_NO_ERROR; -} - -template ::value, int> = 0> -CHIP_ERROR LogValue(const char * label, size_t indent, X value) -{ - ChipLogProgress(chipTool, "%s%s: %s", IndentStr(indent).c_str(), label, std::to_string(value).c_str()); - return CHIP_NO_ERROR; -} - -CHIP_ERROR LogValue(const char * label, size_t indent, bool value) -{ - ChipLogProgress(chipTool, "%s%s: %s", IndentStr(indent).c_str(), label, value ? "TRUE" : "FALSE"); - return CHIP_NO_ERROR; -} - -template ::value, int> = 0> -CHIP_ERROR LogValue(const char * label, size_t indent, X value) -{ - return LogValue(label, indent, chip::to_underlying(value)); -} - -CHIP_ERROR LogValue(const char * label, size_t indent, chip::CharSpan value) -{ - ChipLogProgress(chipTool, "%s%s: %.*s", IndentStr(indent).c_str(), label, static_cast(value.size()), value.data()); - return CHIP_NO_ERROR; -} - -CHIP_ERROR LogValue(const char * label, size_t indent, chip::ByteSpan value) -{ - char buffer[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE]; - if (CHIP_NO_ERROR == - chip::Encoding::BytesToUppercaseHexString(value.data(), value.size(), &buffer[0], CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE)) - { - ChipLogProgress(chipTool, "%s%s: %s", IndentStr(indent).c_str(), label, buffer); - } - else - { - ChipLogProgress(chipTool, "%s%s: %zu", IndentStr(indent).c_str(), label, value.size()); - } - return CHIP_NO_ERROR; -} - -template -CHIP_ERROR LogValue(const char * label, size_t indent, chip::BitFlags value) -{ - return LogValue(label, indent, value.Raw()); -} - -template -CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::DataModel::DecodableList & value) -{ - size_t count = 0; - CHIP_ERROR err = value.ComputeSize(&count); - if (err != CHIP_NO_ERROR) - { - return err; - } - ChipLogProgress(chipTool, "%s%s: %zu entries", IndentStr(indent).c_str(), label, count); - - auto iter = value.begin(); - size_t i = 0; - while (iter.Next()) - { - ++i; - std::string itemLabel = std::string("[") + std::to_string(i) + "]"; - ReturnErrorOnFailure(LogValue(itemLabel.c_str(), indent + 1, iter.GetValue())); - } - if (iter.GetStatus() != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sList truncated due to invalid value", IndentStr(indent + 1).c_str()); - } - return iter.GetStatus(); -} - -template -CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::DataModel::Nullable & value) -{ - if (!value.IsNull()) - { - return LogValue(label, indent, value.Value()); - } - ChipLogProgress(chipTool, "%s%s: null", IndentStr(indent).c_str(), label); - return CHIP_NO_ERROR; -} - -template -CHIP_ERROR LogValue(const char * label, size_t indent, const chip::Optional & value) -{ - if (value.HasValue()) - { - return LogValue(label, indent, value.Value()); - } - - return CHIP_NO_ERROR; -} - -// We output helpers for all structs here, including ones we might not actually -// be logging. -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-function" -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::detail::Structs::LabelStruct::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("Label", indent + 1, value.label); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Label'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Value", indent + 1, value.value); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Value'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} - -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::Scenes::Structs::SceneExtensionFieldSet::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("ClusterId", indent + 1, value.clusterId); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'ClusterId'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Length", indent + 1, value.length); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Length'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Value", indent + 1, value.value); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Value'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::PowerProfile::Structs::PowerProfileRecord::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("PowerProfileId", indent + 1, value.powerProfileId); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'PowerProfileId'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("EnergyPhaseId", indent + 1, value.energyPhaseId); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'EnergyPhaseId'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("PowerProfileRemoteControl", indent + 1, value.powerProfileRemoteControl); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'PowerProfileRemoteControl'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("PowerProfileState", indent + 1, value.powerProfileState); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'PowerProfileState'", - IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::PowerProfile::Structs::ScheduledPhase::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("EnergyPhaseId", indent + 1, value.energyPhaseId); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'EnergyPhaseId'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("ScheduledTime", indent + 1, value.scheduledTime); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'ScheduledTime'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::PowerProfile::Structs::TransferredPhase::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("EnergyPhaseId", indent + 1, value.energyPhaseId); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'EnergyPhaseId'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("MacroPhaseId", indent + 1, value.macroPhaseId); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'MacroPhaseId'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("ExpectedDuration", indent + 1, value.expectedDuration); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'ExpectedDuration'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("PeakPower", indent + 1, value.peakPower); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'PeakPower'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Energy", indent + 1, value.energy); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Energy'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("MaxActivationDelay", indent + 1, value.maxActivationDelay); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'MaxActivationDelay'", - IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::Descriptor::Structs::DeviceType::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("Type", indent + 1, value.type); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Type'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Revision", indent + 1, value.revision); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Revision'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::AccessControl::Structs::Target::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("Cluster", indent + 1, value.cluster); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Cluster'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Endpoint", indent + 1, value.endpoint); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Endpoint'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("DeviceType", indent + 1, value.deviceType); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'DeviceType'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::AccessControl::Structs::AccessControlEntry::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'FabricIndex'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Privilege", indent + 1, value.privilege); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Privilege'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("AuthMode", indent + 1, value.authMode); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'AuthMode'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Subjects", indent + 1, value.subjects); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Subjects'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Targets", indent + 1, value.targets); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Targets'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::AccessControl::Structs::ExtensionEntry::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'FabricIndex'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Data", indent + 1, value.data); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Data'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::BridgedActions::Structs::ActionStruct::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("ActionID", indent + 1, value.actionID); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'ActionID'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Name", indent + 1, value.name); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Name'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Type", indent + 1, value.type); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Type'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("EndpointListID", indent + 1, value.endpointListID); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'EndpointListID'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("SupportedCommands", indent + 1, value.supportedCommands); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'SupportedCommands'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Status", indent + 1, value.status); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Status'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::BridgedActions::Structs::EndpointListStruct::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("EndpointListID", indent + 1, value.endpointListID); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'EndpointListID'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Name", indent + 1, value.name); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Name'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Type", indent + 1, value.type); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Type'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Endpoints", indent + 1, value.endpoints); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Endpoints'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::OtaSoftwareUpdateRequestor::Structs::ProviderLocation::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'FabricIndex'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("ProviderNodeID", indent + 1, value.providerNodeID); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'ProviderNodeID'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Endpoint", indent + 1, value.endpoint); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Endpoint'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::GeneralCommissioning::Structs::BasicCommissioningInfoType::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("FailSafeExpiryLengthMs", indent + 1, value.failSafeExpiryLengthMs); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'FailSafeExpiryLengthMs'", - IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::NetworkCommissioning::Structs::NetworkInfo::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("NetworkID", indent + 1, value.networkID); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'NetworkID'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Connected", indent + 1, value.connected); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Connected'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::NetworkCommissioning::Structs::ThreadInterfaceScanResult::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("PanId", indent + 1, value.panId); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'PanId'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("ExtendedPanId", indent + 1, value.extendedPanId); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'ExtendedPanId'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("NetworkName", indent + 1, value.networkName); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'NetworkName'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Channel", indent + 1, value.channel); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Channel'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Version", indent + 1, value.version); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Version'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("ExtendedAddress", indent + 1, value.extendedAddress); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'ExtendedAddress'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Rssi", indent + 1, value.rssi); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Rssi'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Lqi", indent + 1, value.lqi); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Lqi'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::NetworkCommissioning::Structs::WiFiInterfaceScanResult::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("Security", indent + 1, value.security); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Security'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Ssid", indent + 1, value.ssid); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Ssid'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Bssid", indent + 1, value.bssid); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Bssid'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Channel", indent + 1, value.channel); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Channel'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("WiFiBand", indent + 1, value.wiFiBand); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'WiFiBand'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Rssi", indent + 1, value.rssi); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Rssi'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::GeneralDiagnostics::Structs::NetworkInterfaceType::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("Name", indent + 1, value.name); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Name'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("FabricConnected", indent + 1, value.fabricConnected); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'FabricConnected'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("OffPremiseServicesReachableIPv4", indent + 1, value.offPremiseServicesReachableIPv4); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'OffPremiseServicesReachableIPv4'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("OffPremiseServicesReachableIPv6", indent + 1, value.offPremiseServicesReachableIPv6); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'OffPremiseServicesReachableIPv6'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("HardwareAddress", indent + 1, value.hardwareAddress); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'HardwareAddress'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Type", indent + 1, value.type); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Type'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::SoftwareDiagnostics::Structs::SoftwareFault::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("Id", indent + 1, value.id); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Id'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Name", indent + 1, value.name); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Name'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("FaultRecording", indent + 1, value.faultRecording); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'FaultRecording'", - IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::SoftwareDiagnostics::Structs::ThreadMetrics::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("Id", indent + 1, value.id); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Id'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Name", indent + 1, value.name); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Name'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("StackFreeCurrent", indent + 1, value.stackFreeCurrent); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'StackFreeCurrent'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("StackFreeMinimum", indent + 1, value.stackFreeMinimum); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'StackFreeMinimum'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("StackSize", indent + 1, value.stackSize); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'StackSize'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ThreadNetworkDiagnostics::Structs::NeighborTable::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("ExtAddress", indent + 1, value.extAddress); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'ExtAddress'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Age", indent + 1, value.age); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Age'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Rloc16", indent + 1, value.rloc16); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Rloc16'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("LinkFrameCounter", indent + 1, value.linkFrameCounter); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'LinkFrameCounter'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("MleFrameCounter", indent + 1, value.mleFrameCounter); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'MleFrameCounter'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Lqi", indent + 1, value.lqi); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Lqi'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("AverageRssi", indent + 1, value.averageRssi); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'AverageRssi'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("LastRssi", indent + 1, value.lastRssi); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'LastRssi'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("FrameErrorRate", indent + 1, value.frameErrorRate); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'FrameErrorRate'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("MessageErrorRate", indent + 1, value.messageErrorRate); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'MessageErrorRate'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("RxOnWhenIdle", indent + 1, value.rxOnWhenIdle); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'RxOnWhenIdle'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("FullThreadDevice", indent + 1, value.fullThreadDevice); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'FullThreadDevice'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("FullNetworkData", indent + 1, value.fullNetworkData); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'FullNetworkData'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("IsChild", indent + 1, value.isChild); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'IsChild'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR -LogValue(const char * label, size_t indent, - const chip::app::Clusters::ThreadNetworkDiagnostics::Structs::OperationalDatasetComponents::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("ActiveTimestampPresent", indent + 1, value.activeTimestampPresent); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'ActiveTimestampPresent'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("PendingTimestampPresent", indent + 1, value.pendingTimestampPresent); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'PendingTimestampPresent'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("MasterKeyPresent", indent + 1, value.masterKeyPresent); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'MasterKeyPresent'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("NetworkNamePresent", indent + 1, value.networkNamePresent); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'NetworkNamePresent'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("ExtendedPanIdPresent", indent + 1, value.extendedPanIdPresent); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'ExtendedPanIdPresent'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("MeshLocalPrefixPresent", indent + 1, value.meshLocalPrefixPresent); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'MeshLocalPrefixPresent'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("DelayPresent", indent + 1, value.delayPresent); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'DelayPresent'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("PanIdPresent", indent + 1, value.panIdPresent); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'PanIdPresent'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("ChannelPresent", indent + 1, value.channelPresent); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'ChannelPresent'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("PskcPresent", indent + 1, value.pskcPresent); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'PskcPresent'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("SecurityPolicyPresent", indent + 1, value.securityPolicyPresent); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'SecurityPolicyPresent'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("ChannelMaskPresent", indent + 1, value.channelMaskPresent); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'ChannelMaskPresent'", - IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ThreadNetworkDiagnostics::Structs::RouteTable::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("ExtAddress", indent + 1, value.extAddress); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'ExtAddress'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Rloc16", indent + 1, value.rloc16); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Rloc16'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("RouterId", indent + 1, value.routerId); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'RouterId'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("NextHop", indent + 1, value.nextHop); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'NextHop'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("PathCost", indent + 1, value.pathCost); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'PathCost'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("LQIIn", indent + 1, value.LQIIn); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'LQIIn'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("LQIOut", indent + 1, value.LQIOut); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'LQIOut'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Age", indent + 1, value.age); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Age'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Allocated", indent + 1, value.allocated); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Allocated'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("LinkEstablished", indent + 1, value.linkEstablished); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'LinkEstablished'", - IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ThreadNetworkDiagnostics::Structs::SecurityPolicy::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("RotationTime", indent + 1, value.rotationTime); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'RotationTime'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Flags", indent + 1, value.flags); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Flags'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'FabricIndex'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("RootPublicKey", indent + 1, value.rootPublicKey); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'RootPublicKey'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("VendorId", indent + 1, value.vendorId); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'VendorId'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("FabricId", indent + 1, value.fabricId); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'FabricId'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("NodeId", indent + 1, value.nodeId); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'NodeId'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Label", indent + 1, value.label); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Label'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::OperationalCredentials::Structs::NOCStruct::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'FabricIndex'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Noc", indent + 1, value.noc); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Noc'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Icac", indent + 1, value.icac); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Icac'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::GroupKeyManagement::Structs::GroupInfoMapStruct::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'FabricIndex'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("GroupId", indent + 1, value.groupId); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupId'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Endpoints", indent + 1, value.endpoints); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Endpoints'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("GroupName", indent + 1, value.groupName); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupName'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'FabricIndex'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("GroupId", indent + 1, value.groupId); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupId'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("GroupKeySetID", indent + 1, value.groupKeySetID); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupKeySetID'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("GroupKeySetID", indent + 1, value.groupKeySetID); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupKeySetID'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("GroupKeySecurityPolicy", indent + 1, value.groupKeySecurityPolicy); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupKeySecurityPolicy'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("EpochKey0", indent + 1, value.epochKey0); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'EpochKey0'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("EpochStartTime0", indent + 1, value.epochStartTime0); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'EpochStartTime0'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("EpochKey1", indent + 1, value.epochKey1); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'EpochKey1'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("EpochStartTime1", indent + 1, value.epochStartTime1); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'EpochStartTime1'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("EpochKey2", indent + 1, value.epochKey2); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'EpochKey2'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("EpochStartTime2", indent + 1, value.epochStartTime2); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'EpochStartTime2'", - IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ModeSelect::Structs::ModeOptionStruct::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("Label", indent + 1, value.label); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Label'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Mode", indent + 1, value.mode); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Mode'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("SemanticTag", indent + 1, value.semanticTag); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'SemanticTag'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ModeSelect::Structs::SemanticTag::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("MfgCode", indent + 1, value.mfgCode); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'MfgCode'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Value", indent + 1, value.value); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Value'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::DoorLock::Structs::DlCredential::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("CredentialType", indent + 1, value.credentialType); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'CredentialType'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("CredentialIndex", indent + 1, value.credentialIndex); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'CredentialIndex'", - IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::IasAce::Structs::IasAceZoneStatusResult::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("ZoneId", indent + 1, value.zoneId); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'ZoneId'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("ZoneStatus", indent + 1, value.zoneStatus); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'ZoneStatus'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::Channel::Structs::ChannelInfo::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("MajorNumber", indent + 1, value.majorNumber); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'MajorNumber'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("MinorNumber", indent + 1, value.minorNumber); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'MinorNumber'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Name", indent + 1, value.name); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Name'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("CallSign", indent + 1, value.callSign); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'CallSign'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("AffiliateCallSign", indent + 1, value.affiliateCallSign); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'AffiliateCallSign'", - IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::Channel::Structs::LineupInfo::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("OperatorName", indent + 1, value.operatorName); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'OperatorName'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("LineupName", indent + 1, value.lineupName); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'LineupName'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("PostalCode", indent + 1, value.postalCode); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'PostalCode'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("LineupInfoType", indent + 1, value.lineupInfoType); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'LineupInfoType'", - IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::TargetNavigator::Structs::TargetInfo::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("Identifier", indent + 1, value.identifier); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Identifier'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Name", indent + 1, value.name); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Name'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::MediaPlayback::Structs::PlaybackPosition::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("UpdatedAt", indent + 1, value.updatedAt); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'UpdatedAt'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Position", indent + 1, value.position); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Position'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::MediaInput::Structs::InputInfo::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("Index", indent + 1, value.index); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Index'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("InputType", indent + 1, value.inputType); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'InputType'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Name", indent + 1, value.name); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Name'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Description", indent + 1, value.description); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Description'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ContentLauncher::Structs::Dimension::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("Width", indent + 1, value.width); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Width'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Height", indent + 1, value.height); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Height'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Metric", indent + 1, value.metric); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Metric'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ContentLauncher::Structs::AdditionalInfo::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("Name", indent + 1, value.name); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Name'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Value", indent + 1, value.value); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Value'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ContentLauncher::Structs::Parameter::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("Type", indent + 1, value.type); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Type'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Value", indent + 1, value.value); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Value'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("ExternalIDList", indent + 1, value.externalIDList); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'ExternalIDList'", - IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ContentLauncher::Structs::ContentSearch::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("ParameterList", indent + 1, value.parameterList); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'ParameterList'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ContentLauncher::Structs::StyleInformation::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("ImageUrl", indent + 1, value.imageUrl); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'ImageUrl'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Color", indent + 1, value.color); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Color'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Size", indent + 1, value.size); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Size'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ContentLauncher::Structs::BrandingInformation::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("ProviderName", indent + 1, value.providerName); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'ProviderName'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Background", indent + 1, value.background); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Background'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Logo", indent + 1, value.logo); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Logo'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("ProgressBar", indent + 1, value.progressBar); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'ProgressBar'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Splash", indent + 1, value.splash); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Splash'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("WaterMark", indent + 1, value.waterMark); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'WaterMark'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::AudioOutput::Structs::OutputInfo::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("Index", indent + 1, value.index); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Index'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("OutputType", indent + 1, value.outputType); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'OutputType'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Name", indent + 1, value.name); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Name'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationLauncherApplication::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("CatalogVendorId", indent + 1, value.catalogVendorId); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'CatalogVendorId'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("ApplicationId", indent + 1, value.applicationId); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'ApplicationId'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("Application", indent + 1, value.application); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Application'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Endpoint", indent + 1, value.endpoint); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Endpoint'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("CatalogVendorId", indent + 1, value.catalogVendorId); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'CatalogVendorId'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("ApplicationId", indent + 1, value.applicationId); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'ApplicationId'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::TestCluster::Structs::SimpleStruct::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("A", indent + 1, value.a); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'A'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("B", indent + 1, value.b); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'B'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("C", indent + 1, value.c); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'C'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("D", indent + 1, value.d); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'D'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("E", indent + 1, value.e); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'E'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("F", indent + 1, value.f); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'F'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("G", indent + 1, value.g); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'G'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("H", indent + 1, value.h); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'H'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::TestCluster::Structs::NullablesAndOptionalsStruct::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("NullableInt", indent + 1, value.nullableInt); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'NullableInt'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("OptionalInt", indent + 1, value.optionalInt); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'OptionalInt'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("NullableOptionalInt", indent + 1, value.nullableOptionalInt); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'NullableOptionalInt'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("NullableString", indent + 1, value.nullableString); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'NullableString'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("OptionalString", indent + 1, value.optionalString); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'OptionalString'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("NullableOptionalString", indent + 1, value.nullableOptionalString); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'NullableOptionalString'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("NullableStruct", indent + 1, value.nullableStruct); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'NullableStruct'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("OptionalStruct", indent + 1, value.optionalStruct); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'OptionalStruct'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("NullableOptionalStruct", indent + 1, value.nullableOptionalStruct); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'NullableOptionalStruct'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("NullableList", indent + 1, value.nullableList); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'NullableList'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("OptionalList", indent + 1, value.optionalList); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'OptionalList'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("NullableOptionalList", indent + 1, value.nullableOptionalList); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'NullableOptionalList'", - IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::TestCluster::Structs::NestedStruct::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("A", indent + 1, value.a); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'A'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("B", indent + 1, value.b); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'B'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("C", indent + 1, value.c); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'C'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::TestCluster::Structs::NestedStructList::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("A", indent + 1, value.a); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'A'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("B", indent + 1, value.b); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'B'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("C", indent + 1, value.c); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'C'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("D", indent + 1, value.d); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'D'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("E", indent + 1, value.e); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'E'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("F", indent + 1, value.f); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'F'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("G", indent + 1, value.g); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'G'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::TestCluster::Structs::DoubleNestedStructList::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("A", indent + 1, value.a); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'A'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::TestCluster::Structs::TestFabricScoped::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'FabricIndex'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::TestCluster::Structs::TestListStructOctet::DecodableType & value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'FabricIndex'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("OperationalCert", indent + 1, value.operationalCert); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'OperationalCert'", - IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -#pragma GCC diagnostic pop - -// We output helpers for all events here, including ones we might not actually -// be logging. -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-function" -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::AccessControl::Events::AccessControlEntryChanged::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("AdminFabricIndex", indent + 1, value.adminFabricIndex); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'AdminFabricIndex'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("AdminNodeID", indent + 1, value.adminNodeID); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'AdminNodeID'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("AdminPasscodeID", indent + 1, value.adminPasscodeID); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'AdminPasscodeID'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("ChangeType", indent + 1, value.changeType); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'ChangeType'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("LatestValue", indent + 1, value.latestValue); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'LatestValue'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::AccessControl::Events::AccessControlExtensionChanged::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("AdminFabricIndex", indent + 1, value.adminFabricIndex); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'AdminFabricIndex'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("AdminNodeID", indent + 1, value.adminNodeID); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'AdminNodeID'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("AdminPasscodeID", indent + 1, value.adminPasscodeID); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'AdminPasscodeID'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("ChangeType", indent + 1, value.changeType); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'ChangeType'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("LatestValue", indent + 1, value.latestValue); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'LatestValue'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::BridgedActions::Events::StateChanged::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("ActionID", indent + 1, value.actionID); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'ActionID'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("InvokeID", indent + 1, value.invokeID); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'InvokeID'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("NewState", indent + 1, value.newState); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'NewState'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::BridgedActions::Events::ActionFailed::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("ActionID", indent + 1, value.actionID); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'ActionID'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("InvokeID", indent + 1, value.invokeID); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'InvokeID'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("NewState", indent + 1, value.newState); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'NewState'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Error", indent + 1, value.error); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'Error'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::Basic::Events::StartUp::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("SoftwareVersion", indent + 1, value.softwareVersion); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'SoftwareVersion'", - IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::Basic::Events::ShutDown::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::Basic::Events::Leave::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::Basic::Events::ReachableChanged::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("ReachableNewValue", indent + 1, value.reachableNewValue); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'ReachableNewValue'", - IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::OtaSoftwareUpdateRequestor::Events::StateTransition::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("PreviousState", indent + 1, value.previousState); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'PreviousState'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("NewState", indent + 1, value.newState); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'NewState'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Reason", indent + 1, value.reason); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'Reason'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("TargetSoftwareVersion", indent + 1, value.targetSoftwareVersion); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'TargetSoftwareVersion'", - IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::OtaSoftwareUpdateRequestor::Events::VersionApplied::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("SoftwareVersion", indent + 1, value.softwareVersion); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'SoftwareVersion'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("ProductID", indent + 1, value.productID); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'ProductID'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::OtaSoftwareUpdateRequestor::Events::DownloadError::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("SoftwareVersion", indent + 1, value.softwareVersion); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'SoftwareVersion'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("BytesDownloaded", indent + 1, value.bytesDownloaded); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'BytesDownloaded'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("ProgressPercent", indent + 1, value.progressPercent); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'ProgressPercent'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("PlatformCode", indent + 1, value.platformCode); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'PlatformCode'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::GeneralDiagnostics::Events::HardwareFaultChange::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("Current", indent + 1, value.current); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'Current'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Previous", indent + 1, value.previous); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'Previous'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::GeneralDiagnostics::Events::RadioFaultChange::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("Current", indent + 1, value.current); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'Current'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Previous", indent + 1, value.previous); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'Previous'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::GeneralDiagnostics::Events::NetworkFaultChange::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("Current", indent + 1, value.current); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'Current'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Previous", indent + 1, value.previous); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'Previous'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::GeneralDiagnostics::Events::BootReason::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("BootReason", indent + 1, value.bootReason); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'BootReason'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::SoftwareDiagnostics::Events::SoftwareFault::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("SoftwareFault", indent + 1, value.softwareFault); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'SoftwareFault'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::ThreadNetworkDiagnostics::Events::ConnectionStatus::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("ConnectionStatus", indent + 1, value.connectionStatus); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'ConnectionStatus'", - IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::WiFiNetworkDiagnostics::Events::Disconnection::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("ReasonCode", indent + 1, value.reasonCode); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'ReasonCode'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::WiFiNetworkDiagnostics::Events::AssociationFailure::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("AssociationFailure", indent + 1, value.associationFailure); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'AssociationFailure'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Status", indent + 1, value.status); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'Status'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::WiFiNetworkDiagnostics::Events::ConnectionStatus::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("ConnectionStatus", indent + 1, value.connectionStatus); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'ConnectionStatus'", - IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::Switch::Events::SwitchLatched::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("NewPosition", indent + 1, value.newPosition); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'NewPosition'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::Switch::Events::InitialPress::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("NewPosition", indent + 1, value.newPosition); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'NewPosition'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::Switch::Events::LongPress::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("NewPosition", indent + 1, value.newPosition); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'NewPosition'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::Switch::Events::ShortRelease::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("PreviousPosition", indent + 1, value.previousPosition); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'PreviousPosition'", - IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::Switch::Events::LongRelease::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("PreviousPosition", indent + 1, value.previousPosition); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'PreviousPosition'", - IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::Switch::Events::MultiPressOngoing::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("NewPosition", indent + 1, value.newPosition); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'NewPosition'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("CurrentNumberOfPressesCounted", indent + 1, value.currentNumberOfPressesCounted); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'CurrentNumberOfPressesCounted'", - IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::Switch::Events::MultiPressComplete::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("NewPosition", indent + 1, value.newPosition); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'NewPosition'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("TotalNumberOfPressesCounted", indent + 1, value.totalNumberOfPressesCounted); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'TotalNumberOfPressesCounted'", - IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::BooleanState::Events::StateChange::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("StateValue", indent + 1, value.stateValue); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'StateValue'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::DoorLock::Events::DoorLockAlarm::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("AlarmCode", indent + 1, value.alarmCode); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'AlarmCode'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::DoorLock::Events::DoorStateChange::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("DoorState", indent + 1, value.doorState); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'DoorState'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::DoorLock::Events::LockOperation::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("LockOperationType", indent + 1, value.lockOperationType); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'LockOperationType'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("OperationSource", indent + 1, value.operationSource); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'OperationSource'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("UserIndex", indent + 1, value.userIndex); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'UserIndex'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'FabricIndex'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("SourceNode", indent + 1, value.sourceNode); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'SourceNode'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Credentials", indent + 1, value.credentials); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'Credentials'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::DoorLock::Events::LockOperationError::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("LockOperationType", indent + 1, value.lockOperationType); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'LockOperationType'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("OperationSource", indent + 1, value.operationSource); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'OperationSource'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("OperationError", indent + 1, value.operationError); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'OperationError'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("UserIndex", indent + 1, value.userIndex); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'UserIndex'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'FabricIndex'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("SourceNode", indent + 1, value.sourceNode); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'SourceNode'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Credentials", indent + 1, value.credentials); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'Credentials'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::DoorLock::Events::LockUserChange::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("LockDataType", indent + 1, value.lockDataType); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'LockDataType'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("DataOperationType", indent + 1, value.dataOperationType); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'DataOperationType'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("OperationSource", indent + 1, value.operationSource); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'OperationSource'", - IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("UserIndex", indent + 1, value.userIndex); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'UserIndex'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'FabricIndex'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("SourceNode", indent + 1, value.sourceNode); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'SourceNode'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("DataIndex", indent + 1, value.dataIndex); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'DataIndex'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::SupplyVoltageLow::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::SupplyVoltageHigh::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::PowerMissingPhase::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::SystemPressureLow::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::SystemPressureHigh::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::DryRunning::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::MotorTemperatureHigh::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::PumpMotorFatalFailure::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::ElectronicTemperatureHigh::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::PumpBlocked::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::SensorFailure::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::ElectronicNonFatalFailure::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::ElectronicFatalFailure::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::GeneralFault::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::Leakage::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::AirDetection::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, - chip::app::Clusters::PumpConfigurationAndControl::Events::TurbineOperation::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -CHIP_ERROR LogValue(const char * label, size_t indent, chip::app::Clusters::TestCluster::Events::TestEvent::DecodableType value) -{ - ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); - { - CHIP_ERROR err = LogValue("Arg1", indent + 1, value.arg1); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'Arg1'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Arg2", indent + 1, value.arg2); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'Arg2'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Arg3", indent + 1, value.arg3); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'Arg3'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Arg4", indent + 1, value.arg4); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'Arg4'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Arg5", indent + 1, value.arg5); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'Arg5'", IndentStr(indent + 1).c_str()); - return err; - } - } - { - CHIP_ERROR err = LogValue("Arg6", indent + 1, value.arg6); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(chipTool, "%sEvent truncated due to invalid value for 'Arg6'", IndentStr(indent + 1).c_str()); - return err; - } - } - ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); - return CHIP_NO_ERROR; -} -#pragma GCC diagnostic pop -} // anonymous namespace - -static void OnDefaultSuccessResponseWithoutExit(void * context) -{ - ChipLogProgress(chipTool, "Default Success Response"); -} - -static void OnDefaultSuccessResponse(void * context) -{ - ChipLogProgress(chipTool, "Default Success Response"); - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(CHIP_NO_ERROR); -} - -static void OnDefaultFailure(void * context, CHIP_ERROR err) -{ - ChipLogProgress(chipTool, "Default Failure Response: %" CHIP_ERROR_FORMAT, err.Format()); - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(CHIP_ERROR_INTERNAL); -} - -static void OnDefaultSuccess(void * context, const chip::app::DataModel::NullObjectType & data) -{ - OnDefaultSuccessResponse(context); -}; - -template -static void OnGeneralAttributeEventResponse(void * context, const char * label, T value) -{ - CHIP_ERROR err = DataModelLogger::LogValue(label, 0, value); - - auto * command = static_cast(context); - command->SetCommandExitStatus(err); -} - -static void OnAccountLoginGetSetupPINResponseSuccess( - void * context, const chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received GetSetupPINResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("setupPIN", 1, data.setupPIN); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnApplicationLauncherLauncherResponseSuccess( - void * context, const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received LauncherResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("status", 1, data.status); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("data", 1, data.data); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void -OnChannelChangeChannelResponseSuccess(void * context, - const chip::app::Clusters::Channel::Commands::ChangeChannelResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received ChangeChannelResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("channelMatch", 1, data.channelMatch); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("errorType", 1, data.errorType); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void -OnContentLauncherLaunchResponseSuccess(void * context, - const chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received LaunchResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("status", 1, data.status); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("data", 1, data.data); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnDiagnosticLogsRetrieveLogsResponseSuccess( - void * context, const chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received RetrieveLogsResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("status", 1, data.status); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("content", 1, data.content); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("timeStamp", 1, data.timeStamp); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("timeSinceBoot", 1, data.timeSinceBoot); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnDoorLockGetCredentialStatusResponseSuccess( - void * context, const chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received GetCredentialStatusResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("credentialExists", 1, data.credentialExists); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("userIndex", 1, data.userIndex); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("nextCredentialIndex", 1, data.nextCredentialIndex); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnDoorLockGetUserResponseSuccess(void * context, - const chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received GetUserResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("userIndex", 1, data.userIndex); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("userName", 1, data.userName); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("userUniqueId", 1, data.userUniqueId); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("userStatus", 1, data.userStatus); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("userType", 1, data.userType); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("credentialRule", 1, data.credentialRule); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("credentials", 1, data.credentials); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("creatorFabricIndex", 1, data.creatorFabricIndex); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("lastModifiedFabricIndex", 1, data.lastModifiedFabricIndex); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("nextUserIndex", 1, data.nextUserIndex); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void -OnDoorLockSetCredentialResponseSuccess(void * context, - const chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received SetCredentialResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("status", 1, data.status); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("userIndex", 1, data.userIndex); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("nextCredentialIndex", 1, data.nextCredentialIndex); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnGeneralCommissioningArmFailSafeResponseSuccess( - void * context, const chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received ArmFailSafeResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("errorCode", 1, data.errorCode); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("debugText", 1, data.debugText); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnGeneralCommissioningCommissioningCompleteResponseSuccess( - void * context, const chip::app::Clusters::GeneralCommissioning::Commands::CommissioningCompleteResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received CommissioningCompleteResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("errorCode", 1, data.errorCode); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("debugText", 1, data.debugText); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnGeneralCommissioningSetRegulatoryConfigResponseSuccess( - void * context, const chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfigResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received SetRegulatoryConfigResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("errorCode", 1, data.errorCode); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("debugText", 1, data.debugText); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnGroupKeyManagementKeySetReadAllIndicesResponseSuccess( - void * context, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received KeySetReadAllIndicesResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("groupKeySetIDs", 1, data.groupKeySetIDs); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnGroupKeyManagementKeySetReadResponseSuccess( - void * context, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received KeySetReadResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = LogValue("groupKeySet", 1, data.groupKeySet); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnGroupsAddGroupResponseSuccess(void * context, - const chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received AddGroupResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("status", 1, data.status); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("groupId", 1, data.groupId); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnGroupsGetGroupMembershipResponseSuccess( - void * context, const chip::app::Clusters::Groups::Commands::GetGroupMembershipResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received GetGroupMembershipResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("capacity", 1, data.capacity); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("groupList", 1, data.groupList); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void -OnGroupsRemoveGroupResponseSuccess(void * context, - const chip::app::Clusters::Groups::Commands::RemoveGroupResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received RemoveGroupResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("status", 1, data.status); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("groupId", 1, data.groupId); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnGroupsViewGroupResponseSuccess(void * context, - const chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received ViewGroupResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("status", 1, data.status); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("groupId", 1, data.groupId); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("groupName", 1, data.groupName); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void -OnIdentifyIdentifyQueryResponseSuccess(void * context, - const chip::app::Clusters::Identify::Commands::IdentifyQueryResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received IdentifyQueryResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("timeout", 1, data.timeout); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void -OnKeypadInputSendKeyResponseSuccess(void * context, - const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received SendKeyResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("status", 1, data.status); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void -OnMediaPlaybackPlaybackResponseSuccess(void * context, - const chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received PlaybackResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("status", 1, data.status); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnNetworkCommissioningConnectNetworkResponseSuccess( - void * context, const chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetworkResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received ConnectNetworkResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("networkingStatus", 1, data.networkingStatus); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("debugText", 1, data.debugText); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("errorValue", 1, data.errorValue); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnNetworkCommissioningNetworkConfigResponseSuccess( - void * context, const chip::app::Clusters::NetworkCommissioning::Commands::NetworkConfigResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received NetworkConfigResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("networkingStatus", 1, data.networkingStatus); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("debugText", 1, data.debugText); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnNetworkCommissioningScanNetworksResponseSuccess( - void * context, const chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworksResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received ScanNetworksResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("networkingStatus", 1, data.networkingStatus); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("debugText", 1, data.debugText); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("wiFiScanResults", 1, data.wiFiScanResults); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("threadScanResults", 1, data.threadScanResults); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnOtaSoftwareUpdateProviderApplyUpdateResponseSuccess( - void * context, const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received ApplyUpdateResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("action", 1, data.action); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("delayedActionTime", 1, data.delayedActionTime); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnOtaSoftwareUpdateProviderQueryImageResponseSuccess( - void * context, const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received QueryImageResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("status", 1, data.status); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("delayedActionTime", 1, data.delayedActionTime); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("imageURI", 1, data.imageURI); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("softwareVersion", 1, data.softwareVersion); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("softwareVersionString", 1, data.softwareVersionString); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("updateToken", 1, data.updateToken); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("userConsentNeeded", 1, data.userConsentNeeded); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("metadataForRequestor", 1, data.metadataForRequestor); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnOperationalCredentialsAttestationResponseSuccess( - void * context, const chip::app::Clusters::OperationalCredentials::Commands::AttestationResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received AttestationResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("attestationElements", 1, data.attestationElements); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("signature", 1, data.signature); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnOperationalCredentialsCertificateChainResponseSuccess( - void * context, const chip::app::Clusters::OperationalCredentials::Commands::CertificateChainResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received CertificateChainResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("certificate", 1, data.certificate); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnOperationalCredentialsNOCResponseSuccess( - void * context, const chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received NOCResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("statusCode", 1, data.statusCode); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("fabricIndex", 1, data.fabricIndex); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("debugText", 1, data.debugText); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnOperationalCredentialsOpCSRResponseSuccess( - void * context, const chip::app::Clusters::OperationalCredentials::Commands::OpCSRResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received OpCSRResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("NOCSRElements", 1, data.NOCSRElements); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("attestationSignature", 1, data.attestationSignature); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnScenesAddSceneResponseSuccess(void * context, - const chip::app::Clusters::Scenes::Commands::AddSceneResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received AddSceneResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("status", 1, data.status); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("groupId", 1, data.groupId); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("sceneId", 1, data.sceneId); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnScenesGetSceneMembershipResponseSuccess( - void * context, const chip::app::Clusters::Scenes::Commands::GetSceneMembershipResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received GetSceneMembershipResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("status", 1, data.status); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("capacity", 1, data.capacity); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("groupId", 1, data.groupId); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("sceneCount", 1, data.sceneCount); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("sceneList", 1, data.sceneList); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void -OnScenesRemoveAllScenesResponseSuccess(void * context, - const chip::app::Clusters::Scenes::Commands::RemoveAllScenesResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received RemoveAllScenesResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("status", 1, data.status); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("groupId", 1, data.groupId); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void -OnScenesRemoveSceneResponseSuccess(void * context, - const chip::app::Clusters::Scenes::Commands::RemoveSceneResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received RemoveSceneResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("status", 1, data.status); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("groupId", 1, data.groupId); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("sceneId", 1, data.sceneId); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnScenesStoreSceneResponseSuccess(void * context, - const chip::app::Clusters::Scenes::Commands::StoreSceneResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received StoreSceneResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("status", 1, data.status); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("groupId", 1, data.groupId); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("sceneId", 1, data.sceneId); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnScenesViewSceneResponseSuccess(void * context, - const chip::app::Clusters::Scenes::Commands::ViewSceneResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received ViewSceneResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("status", 1, data.status); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("groupId", 1, data.groupId); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("sceneId", 1, data.sceneId); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("transitionTime", 1, data.transitionTime); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("sceneName", 1, data.sceneName); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("extensionFieldSets", 1, data.extensionFieldSets); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnTargetNavigatorNavigateTargetResponseSuccess( - void * context, const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received NavigateTargetResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("status", 1, data.status); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("data", 1, data.data); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void -OnTestClusterBooleanResponseSuccess(void * context, - const chip::app::Clusters::TestCluster::Commands::BooleanResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received BooleanResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("value", 1, data.value); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnTestClusterSimpleStructResponseSuccess( - void * context, const chip::app::Clusters::TestCluster::Commands::SimpleStructResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received SimpleStructResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("arg1", 1, data.arg1); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnTestClusterTestAddArgumentsResponseSuccess( - void * context, const chip::app::Clusters::TestCluster::Commands::TestAddArgumentsResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received TestAddArgumentsResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("returnValue", 1, data.returnValue); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnTestClusterTestEmitTestEventResponseSuccess( - void * context, const chip::app::Clusters::TestCluster::Commands::TestEmitTestEventResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received TestEmitTestEventResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("value", 1, data.value); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void -OnTestClusterTestEnumsResponseSuccess(void * context, - const chip::app::Clusters::TestCluster::Commands::TestEnumsResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received TestEnumsResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("arg1", 1, data.arg1); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("arg2", 1, data.arg2); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnTestClusterTestListInt8UReverseResponseSuccess( - void * context, const chip::app::Clusters::TestCluster::Commands::TestListInt8UReverseResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received TestListInt8UReverseResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("arg1", 1, data.arg1); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnTestClusterTestNullableOptionalResponseSuccess( - void * context, const chip::app::Clusters::TestCluster::Commands::TestNullableOptionalResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received TestNullableOptionalResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("wasPresent", 1, data.wasPresent); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("wasNull", 1, data.wasNull); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("value", 1, data.value); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("originalValue", 1, data.originalValue); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnTestClusterTestSpecificResponseSuccess( - void * context, const chip::app::Clusters::TestCluster::Commands::TestSpecificResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received TestSpecificResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("returnValue", 1, data.returnValue); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnThermostatGetRelayStatusLogResponseSuccess( - void * context, const chip::app::Clusters::Thermostat::Commands::GetRelayStatusLogResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received GetRelayStatusLogResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("timeOfDay", 1, data.timeOfDay); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("relayStatus", 1, data.relayStatus); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("localTemperature", 1, data.localTemperature); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("humidityInPercentage", 1, data.humidityInPercentage); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("setpoint", 1, data.setpoint); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("unreadEntries", 1, data.unreadEntries); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnThermostatGetWeeklyScheduleResponseSuccess( - void * context, const chip::app::Clusters::Thermostat::Commands::GetWeeklyScheduleResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received GetWeeklyScheduleResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("numberOfTransitionsForSequence", 1, data.numberOfTransitionsForSequence); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("dayOfWeekForSequence", 1, data.dayOfWeekForSequence); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("modeForSequence", 1, data.modeForSequence); - } - if (err == CHIP_NO_ERROR) - { - err = DataModelLogger::LogValue("payload", 1, data.payload); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -/*----------------------------------------------------------------------------*\ -| Cluster Name | ID | -|---------------------------------------------------------------------+--------| -| AccessControl | 0x001F | -| AccountLogin | 0x050E | -| AdministratorCommissioning | 0x003C | -| ApplicationBasic | 0x050D | -| ApplicationLauncher | 0x050C | -| AudioOutput | 0x050B | -| BarrierControl | 0x0103 | -| Basic | 0x0028 | -| BinaryInputBasic | 0x000F | -| Binding | 0x001E | -| BooleanState | 0x0045 | -| BridgedActions | 0x0025 | -| BridgedDeviceBasic | 0x0039 | -| Channel | 0x0504 | -| ColorControl | 0x0300 | -| ContentLauncher | 0x050A | -| Descriptor | 0x001D | -| DiagnosticLogs | 0x0032 | -| DoorLock | 0x0101 | -| ElectricalMeasurement | 0x0B04 | -| EthernetNetworkDiagnostics | 0x0037 | -| FixedLabel | 0x0040 | -| FlowMeasurement | 0x0404 | -| GeneralCommissioning | 0x0030 | -| GeneralDiagnostics | 0x0033 | -| GroupKeyManagement | 0x003F | -| Groups | 0x0004 | -| Identify | 0x0003 | -| IlluminanceMeasurement | 0x0400 | -| KeypadInput | 0x0509 | -| LevelControl | 0x0008 | -| LocalizationConfiguration | 0x002B | -| LowPower | 0x0508 | -| MediaInput | 0x0507 | -| MediaPlayback | 0x0506 | -| ModeSelect | 0x0050 | -| NetworkCommissioning | 0x0031 | -| OtaSoftwareUpdateProvider | 0x0029 | -| OtaSoftwareUpdateRequestor | 0x002A | -| OccupancySensing | 0x0406 | -| OnOff | 0x0006 | -| OnOffSwitchConfiguration | 0x0007 | -| OperationalCredentials | 0x003E | -| PowerSource | 0x002F | -| PowerSourceConfiguration | 0x002E | -| PressureMeasurement | 0x0403 | -| PumpConfigurationAndControl | 0x0200 | -| RelativeHumidityMeasurement | 0x0405 | -| Scenes | 0x0005 | -| SoftwareDiagnostics | 0x0034 | -| Switch | 0x003B | -| TargetNavigator | 0x0505 | -| TemperatureMeasurement | 0x0402 | -| TestCluster | 0x050F | -| Thermostat | 0x0201 | -| ThermostatUserInterfaceConfiguration | 0x0204 | -| ThreadNetworkDiagnostics | 0x0035 | -| TimeFormatLocalization | 0x002C | -| UnitLocalization | 0x002D | -| UserLabel | 0x0041 | -| WakeOnLan | 0x0503 | -| WiFiNetworkDiagnostics | 0x0036 | -| WindowCovering | 0x0102 | -\*----------------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------------*\ -| Cluster AccessControl | 0x001F | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * Acl | 0x0000 | -| * Extension | 0x0001 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -| * AccessControlEntryChanged | 0x0000 | -| * AccessControlExtensionChanged | 0x0001 | -\*----------------------------------------------------------------------------*/ - -/* - * Event AccessControlEntryChanged - */ -class ReadAccessControlAccessControlEntryChanged : public ModelCommand -{ -public: - ReadAccessControlAccessControlEntryChanged() : ModelCommand("read-event") - { - AddArgument("event-name", "access-control-entry-changed"); - ModelCommand::AddArguments(); - } - - ~ReadAccessControlAccessControlEntryChanged() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001F) ReadEvent (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::AccessControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void OnEventResponse(void * context, - chip::app::Clusters::AccessControl::Events::AccessControlEntryChanged::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "AccessControl.AccessControlEntryChanged response", value); - } -}; - -class ReportAccessControlAccessControlEntryChanged : public ModelCommand -{ -public: - ReportAccessControlAccessControlEntryChanged() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "access-control-entry-changed"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportAccessControlAccessControlEntryChanged() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001F) ReportEvent (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::AccessControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - chip::app::Clusters::AccessControl::Events::AccessControlEntryChanged::DecodableType value) - { - DataModelLogger::LogValue("AccessControl.AccessControlEntryChanged report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event AccessControlExtensionChanged - */ -class ReadAccessControlAccessControlExtensionChanged : public ModelCommand -{ -public: - ReadAccessControlAccessControlExtensionChanged() : ModelCommand("read-event") - { - AddArgument("event-name", "access-control-extension-changed"); - ModelCommand::AddArguments(); - } - - ~ReadAccessControlAccessControlExtensionChanged() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001F) ReadEvent (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::AccessControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void OnEventResponse(void * context, - chip::app::Clusters::AccessControl::Events::AccessControlExtensionChanged::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "AccessControl.AccessControlExtensionChanged response", value); - } -}; - -class ReportAccessControlAccessControlExtensionChanged : public ModelCommand -{ -public: - ReportAccessControlAccessControlExtensionChanged() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "access-control-extension-changed"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportAccessControlAccessControlExtensionChanged() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001F) ReportEvent (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::AccessControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - chip::app::Clusters::AccessControl::Events::AccessControlExtensionChanged::DecodableType value) - { - DataModelLogger::LogValue("AccessControl.AccessControlExtensionChanged report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Acl - */ -class ReadAccessControlAcl : public ModelCommand -{ -public: - ReadAccessControlAcl() : ModelCommand("read") - { - AddArgument("attr-name", "acl"); - ModelCommand::AddArguments(); - } - - ~ReadAccessControlAcl() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001F) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::AccessControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse( - void * context, - const chip::app::DataModel::DecodableList & - value) - { - OnGeneralAttributeEventResponse(context, "AccessControl.Acl response", value); - } -}; - -class WriteAccessControlAcl : public ModelCommand -{ -public: - WriteAccessControlAcl() : ModelCommand("write"), mComplex(&mValue) - { - AddArgument("attr-name", "acl"); - AddArgument("attr-value", &mComplex); - ModelCommand::AddArguments(); - } - - ~WriteAccessControlAcl() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001F) WriteAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::AccessControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::List mValue; - TypedComplexArgument> - mComplex; -}; - -class ReportAccessControlAcl : public ModelCommand -{ -public: - ReportAccessControlAcl() : ModelCommand("subscribe") - { - AddArgument("attr-name", "acl"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportAccessControlAcl() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001F) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::AccessControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport( - void * context, - const chip::app::DataModel::DecodableList & - value) - { - DataModelLogger::LogValue("AccessControl.Acl report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Extension - */ -class ReadAccessControlExtension : public ModelCommand -{ -public: - ReadAccessControlExtension() : ModelCommand("read") - { - AddArgument("attr-name", "extension"); - ModelCommand::AddArguments(); - } - - ~ReadAccessControlExtension() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001F) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::AccessControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse( - void * context, - const chip::app::DataModel::DecodableList & - value) - { - OnGeneralAttributeEventResponse(context, "AccessControl.Extension response", value); - } -}; - -class WriteAccessControlExtension : public ModelCommand -{ -public: - WriteAccessControlExtension() : ModelCommand("write"), mComplex(&mValue) - { - AddArgument("attr-name", "extension"); - AddArgument("attr-value", &mComplex); - ModelCommand::AddArguments(); - } - - ~WriteAccessControlExtension() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001F) WriteAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::AccessControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::List mValue; - TypedComplexArgument> - mComplex; -}; - -class ReportAccessControlExtension : public ModelCommand -{ -public: - ReportAccessControlExtension() : ModelCommand("subscribe") - { - AddArgument("attr-name", "extension"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportAccessControlExtension() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001F) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::AccessControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport( - void * context, - const chip::app::DataModel::DecodableList & - value) - { - DataModelLogger::LogValue("AccessControl.Extension report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadAccessControlAttributeList : public ModelCommand -{ -public: - ReadAccessControlAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadAccessControlAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001F) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::AccessControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "AccessControl.AttributeList response", value); - } -}; - -class ReportAccessControlAttributeList : public ModelCommand -{ -public: - ReportAccessControlAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportAccessControlAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001F) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::AccessControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("AccessControl.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadAccessControlClusterRevision : public ModelCommand -{ -public: - ReadAccessControlClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadAccessControlClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001F) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::AccessControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "AccessControl.ClusterRevision response", value); - } -}; - -class ReportAccessControlClusterRevision : public ModelCommand -{ -public: - ReportAccessControlClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportAccessControlClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001F) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::AccessControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("AccessControl.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster AccountLogin | 0x050E | -|------------------------------------------------------------------------------| -| Commands: | | -| * GetSetupPINRequest | 0x00 | -| * LoginRequest | 0x02 | -| * LogoutRequest | 0x03 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command GetSetupPINRequest - */ -class AccountLoginGetSetupPINRequest : public ModelCommand -{ -public: - AccountLoginGetSetupPINRequest() : ModelCommand("get-setup-pinrequest") - { - AddArgument("TempAccountIdentifier", &mRequest.tempAccountIdentifier); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050E) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnAccountLoginGetSetupPINResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::AccountLogin::Commands::GetSetupPINRequest::Type mRequest; -}; - -/* - * Command LoginRequest - */ -class AccountLoginLoginRequest : public ModelCommand -{ -public: - AccountLoginLoginRequest() : ModelCommand("login-request") - { - AddArgument("TempAccountIdentifier", &mRequest.tempAccountIdentifier); - AddArgument("SetupPIN", &mRequest.setupPIN); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050E) command (0x00000002) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::AccountLogin::Commands::LoginRequest::Type mRequest; -}; - -/* - * Command LogoutRequest - */ -class AccountLoginLogoutRequest : public ModelCommand -{ -public: - AccountLoginLogoutRequest() : ModelCommand("logout-request") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050E) command (0x00000003) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::AccountLogin::Commands::LogoutRequest::Type mRequest; -}; - -/* - * Attribute AttributeList - */ -class ReadAccountLoginAttributeList : public ModelCommand -{ -public: - ReadAccountLoginAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadAccountLoginAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050E) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::AccountLoginCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "AccountLogin.AttributeList response", value); - } -}; - -class ReportAccountLoginAttributeList : public ModelCommand -{ -public: - ReportAccountLoginAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportAccountLoginAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050E) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::AccountLoginCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("AccountLogin.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadAccountLoginClusterRevision : public ModelCommand -{ -public: - ReadAccountLoginClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadAccountLoginClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050E) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::AccountLoginCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "AccountLogin.ClusterRevision response", value); - } -}; - -class ReportAccountLoginClusterRevision : public ModelCommand -{ -public: - ReportAccountLoginClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportAccountLoginClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050E) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::AccountLoginCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("AccountLogin.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster AdministratorCommissioning | 0x003C | -|------------------------------------------------------------------------------| -| Commands: | | -| * OpenBasicCommissioningWindow | 0x01 | -| * OpenCommissioningWindow | 0x00 | -| * RevokeCommissioning | 0x02 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * WindowStatus | 0x0000 | -| * AdminFabricIndex | 0x0001 | -| * AdminVendorId | 0x0002 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command OpenBasicCommissioningWindow - */ -class AdministratorCommissioningOpenBasicCommissioningWindow : public ModelCommand -{ -public: - AdministratorCommissioningOpenBasicCommissioningWindow() : ModelCommand("open-basic-commissioning-window") - { - AddArgument("CommissioningTimeout", 0, UINT16_MAX, &mRequest.commissioningTimeout); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003C) command (0x00000001) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type mRequest; -}; - -/* - * Command OpenCommissioningWindow - */ -class AdministratorCommissioningOpenCommissioningWindow : public ModelCommand -{ -public: - AdministratorCommissioningOpenCommissioningWindow() : ModelCommand("open-commissioning-window") - { - AddArgument("CommissioningTimeout", 0, UINT16_MAX, &mRequest.commissioningTimeout); - AddArgument("PAKEVerifier", &mRequest.PAKEVerifier); - AddArgument("Discriminator", 0, UINT16_MAX, &mRequest.discriminator); - AddArgument("Iterations", 0, UINT32_MAX, &mRequest.iterations); - AddArgument("Salt", &mRequest.salt); - AddArgument("PasscodeID", 0, UINT16_MAX, &mRequest.passcodeID); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003C) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type mRequest; -}; - -/* - * Command RevokeCommissioning - */ -class AdministratorCommissioningRevokeCommissioning : public ModelCommand -{ -public: - AdministratorCommissioningRevokeCommissioning() : ModelCommand("revoke-commissioning") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003C) command (0x00000002) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Type mRequest; -}; - -/* - * Attribute WindowStatus - */ -class ReadAdministratorCommissioningWindowStatus : public ModelCommand -{ -public: - ReadAdministratorCommissioningWindowStatus() : ModelCommand("read") - { - AddArgument("attr-name", "window-status"); - ModelCommand::AddArguments(); - } - - ~ReadAdministratorCommissioningWindowStatus() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003C) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::AdministratorCommissioningCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "AdministratorCommissioning.WindowStatus response", value); - } -}; - -class ReportAdministratorCommissioningWindowStatus : public ModelCommand -{ -public: - ReportAdministratorCommissioningWindowStatus() : ModelCommand("subscribe") - { - AddArgument("attr-name", "window-status"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportAdministratorCommissioningWindowStatus() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003C) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::AdministratorCommissioningCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("AdministratorCommissioning.WindowStatus report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AdminFabricIndex - */ -class ReadAdministratorCommissioningAdminFabricIndex : public ModelCommand -{ -public: - ReadAdministratorCommissioningAdminFabricIndex() : ModelCommand("read") - { - AddArgument("attr-name", "admin-fabric-index"); - ModelCommand::AddArguments(); - } - - ~ReadAdministratorCommissioningAdminFabricIndex() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003C) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::AdministratorCommissioningCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::FabricIndex value) - { - OnGeneralAttributeEventResponse(context, "AdministratorCommissioning.AdminFabricIndex response", value); - } -}; - -class ReportAdministratorCommissioningAdminFabricIndex : public ModelCommand -{ -public: - ReportAdministratorCommissioningAdminFabricIndex() : ModelCommand("subscribe") - { - AddArgument("attr-name", "admin-fabric-index"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportAdministratorCommissioningAdminFabricIndex() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003C) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::AdministratorCommissioningCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::FabricIndex value) - { - DataModelLogger::LogValue("AdministratorCommissioning.AdminFabricIndex report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AdminVendorId - */ -class ReadAdministratorCommissioningAdminVendorId : public ModelCommand -{ -public: - ReadAdministratorCommissioningAdminVendorId() : ModelCommand("read") - { - AddArgument("attr-name", "admin-vendor-id"); - ModelCommand::AddArguments(); - } - - ~ReadAdministratorCommissioningAdminVendorId() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003C) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::AdministratorCommissioningCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "AdministratorCommissioning.AdminVendorId response", value); - } -}; - -class ReportAdministratorCommissioningAdminVendorId : public ModelCommand -{ -public: - ReportAdministratorCommissioningAdminVendorId() : ModelCommand("subscribe") - { - AddArgument("attr-name", "admin-vendor-id"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportAdministratorCommissioningAdminVendorId() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003C) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::AdministratorCommissioningCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("AdministratorCommissioning.AdminVendorId report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadAdministratorCommissioningAttributeList : public ModelCommand -{ -public: - ReadAdministratorCommissioningAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadAdministratorCommissioningAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003C) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::AdministratorCommissioningCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "AdministratorCommissioning.AttributeList response", value); - } -}; - -class ReportAdministratorCommissioningAttributeList : public ModelCommand -{ -public: - ReportAdministratorCommissioningAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportAdministratorCommissioningAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003C) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::AdministratorCommissioningCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("AdministratorCommissioning.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadAdministratorCommissioningClusterRevision : public ModelCommand -{ -public: - ReadAdministratorCommissioningClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadAdministratorCommissioningClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003C) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::AdministratorCommissioningCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "AdministratorCommissioning.ClusterRevision response", value); - } -}; - -class ReportAdministratorCommissioningClusterRevision : public ModelCommand -{ -public: - ReportAdministratorCommissioningClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportAdministratorCommissioningClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003C) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::AdministratorCommissioningCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("AdministratorCommissioning.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster ApplicationBasic | 0x050D | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * VendorName | 0x0000 | -| * VendorId | 0x0001 | -| * ApplicationName | 0x0002 | -| * ProductId | 0x0003 | -| * ApplicationApp | 0x0004 | -| * ApplicationStatus | 0x0005 | -| * ApplicationVersion | 0x0006 | -| * AllowedVendorList | 0x0007 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Attribute VendorName - */ -class ReadApplicationBasicVendorName : public ModelCommand -{ -public: - ReadApplicationBasicVendorName() : ModelCommand("read") - { - AddArgument("attr-name", "vendor-name"); - ModelCommand::AddArguments(); - } - - ~ReadApplicationBasicVendorName() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050D) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::ApplicationBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::CharSpan value) - { - OnGeneralAttributeEventResponse(context, "ApplicationBasic.VendorName response", value); - } -}; - -class ReportApplicationBasicVendorName : public ModelCommand -{ -public: - ReportApplicationBasicVendorName() : ModelCommand("subscribe") - { - AddArgument("attr-name", "vendor-name"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportApplicationBasicVendorName() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050D) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::ApplicationBasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::CharSpan value) - { - DataModelLogger::LogValue("ApplicationBasic.VendorName report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute VendorId - */ -class ReadApplicationBasicVendorId : public ModelCommand -{ -public: - ReadApplicationBasicVendorId() : ModelCommand("read") - { - AddArgument("attr-name", "vendor-id"); - ModelCommand::AddArguments(); - } - - ~ReadApplicationBasicVendorId() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050D) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::ApplicationBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ApplicationBasic.VendorId response", value); - } -}; - -class ReportApplicationBasicVendorId : public ModelCommand -{ -public: - ReportApplicationBasicVendorId() : ModelCommand("subscribe") - { - AddArgument("attr-name", "vendor-id"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportApplicationBasicVendorId() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050D) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::ApplicationBasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ApplicationBasic.VendorId report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ApplicationName - */ -class ReadApplicationBasicApplicationName : public ModelCommand -{ -public: - ReadApplicationBasicApplicationName() : ModelCommand("read") - { - AddArgument("attr-name", "application-name"); - ModelCommand::AddArguments(); - } - - ~ReadApplicationBasicApplicationName() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050D) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::ApplicationBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::CharSpan value) - { - OnGeneralAttributeEventResponse(context, "ApplicationBasic.ApplicationName response", value); - } -}; - -class ReportApplicationBasicApplicationName : public ModelCommand -{ -public: - ReportApplicationBasicApplicationName() : ModelCommand("subscribe") - { - AddArgument("attr-name", "application-name"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportApplicationBasicApplicationName() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050D) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::ApplicationBasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::CharSpan value) - { - DataModelLogger::LogValue("ApplicationBasic.ApplicationName report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ProductId - */ -class ReadApplicationBasicProductId : public ModelCommand -{ -public: - ReadApplicationBasicProductId() : ModelCommand("read") - { - AddArgument("attr-name", "product-id"); - ModelCommand::AddArguments(); - } - - ~ReadApplicationBasicProductId() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050D) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::ApplicationBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ApplicationBasic.ProductId response", value); - } -}; - -class ReportApplicationBasicProductId : public ModelCommand -{ -public: - ReportApplicationBasicProductId() : ModelCommand("subscribe") - { - AddArgument("attr-name", "product-id"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportApplicationBasicProductId() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050D) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::ApplicationBasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ApplicationBasic.ProductId report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ApplicationStatus - */ -class ReadApplicationBasicApplicationStatus : public ModelCommand -{ -public: - ReadApplicationBasicApplicationStatus() : ModelCommand("read") - { - AddArgument("attr-name", "application-status"); - ModelCommand::AddArguments(); - } - - ~ReadApplicationBasicApplicationStatus() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050D) ReadAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::ApplicationBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum value) - { - OnGeneralAttributeEventResponse(context, "ApplicationBasic.ApplicationStatus response", value); - } -}; - -class ReportApplicationBasicApplicationStatus : public ModelCommand -{ -public: - ReportApplicationBasicApplicationStatus() : ModelCommand("subscribe") - { - AddArgument("attr-name", "application-status"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportApplicationBasicApplicationStatus() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050D) ReportAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::ApplicationBasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum value) - { - DataModelLogger::LogValue("ApplicationBasic.ApplicationStatus report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ApplicationVersion - */ -class ReadApplicationBasicApplicationVersion : public ModelCommand -{ -public: - ReadApplicationBasicApplicationVersion() : ModelCommand("read") - { - AddArgument("attr-name", "application-version"); - ModelCommand::AddArguments(); - } - - ~ReadApplicationBasicApplicationVersion() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050D) ReadAttribute (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::ApplicationBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::CharSpan value) - { - OnGeneralAttributeEventResponse(context, "ApplicationBasic.ApplicationVersion response", value); - } -}; - -class ReportApplicationBasicApplicationVersion : public ModelCommand -{ -public: - ReportApplicationBasicApplicationVersion() : ModelCommand("subscribe") - { - AddArgument("attr-name", "application-version"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportApplicationBasicApplicationVersion() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050D) ReportAttribute (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::ApplicationBasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::CharSpan value) - { - DataModelLogger::LogValue("ApplicationBasic.ApplicationVersion report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AllowedVendorList - */ -class ReadApplicationBasicAllowedVendorList : public ModelCommand -{ -public: - ReadApplicationBasicAllowedVendorList() : ModelCommand("read") - { - AddArgument("attr-name", "allowed-vendor-list"); - ModelCommand::AddArguments(); - } - - ~ReadApplicationBasicAllowedVendorList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050D) ReadAttribute (0x00000007) on endpoint %" PRIu16, endpointId); - - chip::Controller::ApplicationBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "ApplicationBasic.AllowedVendorList response", value); - } -}; - -class ReportApplicationBasicAllowedVendorList : public ModelCommand -{ -public: - ReportApplicationBasicAllowedVendorList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "allowed-vendor-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportApplicationBasicAllowedVendorList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050D) ReportAttribute (0x00000007) on endpoint %" PRIu16, endpointId); - - chip::Controller::ApplicationBasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("ApplicationBasic.AllowedVendorList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadApplicationBasicAttributeList : public ModelCommand -{ -public: - ReadApplicationBasicAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadApplicationBasicAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050D) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::ApplicationBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "ApplicationBasic.AttributeList response", value); - } -}; - -class ReportApplicationBasicAttributeList : public ModelCommand -{ -public: - ReportApplicationBasicAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportApplicationBasicAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050D) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::ApplicationBasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("ApplicationBasic.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadApplicationBasicClusterRevision : public ModelCommand -{ -public: - ReadApplicationBasicClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadApplicationBasicClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050D) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::ApplicationBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ApplicationBasic.ClusterRevision response", value); - } -}; - -class ReportApplicationBasicClusterRevision : public ModelCommand -{ -public: - ReportApplicationBasicClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportApplicationBasicClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050D) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::ApplicationBasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ApplicationBasic.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster ApplicationLauncher | 0x050C | -|------------------------------------------------------------------------------| -| Commands: | | -| * HideAppRequest | 0x02 | -| * LaunchAppRequest | 0x00 | -| * StopAppRequest | 0x01 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * ApplicationLauncherList | 0x0000 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command HideAppRequest - */ -class ApplicationLauncherHideAppRequest : public ModelCommand -{ -public: - ApplicationLauncherHideAppRequest() : ModelCommand("hide-app-request"), mComplex_Application(&mRequest.application) - { - AddArgument("Application", &mComplex_Application); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050C) command (0x00000002) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnApplicationLauncherLauncherResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ApplicationLauncher::Commands::HideAppRequest::Type mRequest; - TypedComplexArgument - mComplex_Application; -}; - -/* - * Command LaunchAppRequest - */ -class ApplicationLauncherLaunchAppRequest : public ModelCommand -{ -public: - ApplicationLauncherLaunchAppRequest() : ModelCommand("launch-app-request"), mComplex_Application(&mRequest.application) - { - AddArgument("Data", &mRequest.data); - AddArgument("Application", &mComplex_Application); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050C) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnApplicationLauncherLauncherResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ApplicationLauncher::Commands::LaunchAppRequest::Type mRequest; - TypedComplexArgument - mComplex_Application; -}; - -/* - * Command StopAppRequest - */ -class ApplicationLauncherStopAppRequest : public ModelCommand -{ -public: - ApplicationLauncherStopAppRequest() : ModelCommand("stop-app-request"), mComplex_Application(&mRequest.application) - { - AddArgument("Application", &mComplex_Application); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050C) command (0x00000001) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnApplicationLauncherLauncherResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ApplicationLauncher::Commands::StopAppRequest::Type mRequest; - TypedComplexArgument - mComplex_Application; -}; - -/* - * Attribute ApplicationLauncherList - */ -class ReadApplicationLauncherApplicationLauncherList : public ModelCommand -{ -public: - ReadApplicationLauncherApplicationLauncherList() : ModelCommand("read") - { - AddArgument("attr-name", "application-launcher-list"); - ModelCommand::AddArguments(); - } - - ~ReadApplicationLauncherApplicationLauncherList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050C) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::ApplicationLauncherCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "ApplicationLauncher.ApplicationLauncherList response", value); - } -}; - -class ReportApplicationLauncherApplicationLauncherList : public ModelCommand -{ -public: - ReportApplicationLauncherApplicationLauncherList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "application-launcher-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportApplicationLauncherApplicationLauncherList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050C) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::ApplicationLauncherCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("ApplicationLauncher.ApplicationLauncherList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadApplicationLauncherAttributeList : public ModelCommand -{ -public: - ReadApplicationLauncherAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadApplicationLauncherAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050C) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::ApplicationLauncherCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "ApplicationLauncher.AttributeList response", value); - } -}; - -class ReportApplicationLauncherAttributeList : public ModelCommand -{ -public: - ReportApplicationLauncherAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportApplicationLauncherAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050C) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::ApplicationLauncherCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("ApplicationLauncher.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadApplicationLauncherClusterRevision : public ModelCommand -{ -public: - ReadApplicationLauncherClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadApplicationLauncherClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050C) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::ApplicationLauncherCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ApplicationLauncher.ClusterRevision response", value); - } -}; - -class ReportApplicationLauncherClusterRevision : public ModelCommand -{ -public: - ReportApplicationLauncherClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportApplicationLauncherClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050C) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::ApplicationLauncherCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ApplicationLauncher.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster AudioOutput | 0x050B | -|------------------------------------------------------------------------------| -| Commands: | | -| * RenameOutputRequest | 0x01 | -| * SelectOutputRequest | 0x00 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * AudioOutputList | 0x0000 | -| * CurrentAudioOutput | 0x0001 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command RenameOutputRequest - */ -class AudioOutputRenameOutputRequest : public ModelCommand -{ -public: - AudioOutputRenameOutputRequest() : ModelCommand("rename-output-request") - { - AddArgument("Index", 0, UINT8_MAX, &mRequest.index); - AddArgument("Name", &mRequest.name); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050B) command (0x00000001) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::AudioOutput::Commands::RenameOutputRequest::Type mRequest; -}; - -/* - * Command SelectOutputRequest - */ -class AudioOutputSelectOutputRequest : public ModelCommand -{ -public: - AudioOutputSelectOutputRequest() : ModelCommand("select-output-request") - { - AddArgument("Index", 0, UINT8_MAX, &mRequest.index); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050B) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::AudioOutput::Commands::SelectOutputRequest::Type mRequest; -}; - -/* - * Attribute AudioOutputList - */ -class ReadAudioOutputAudioOutputList : public ModelCommand -{ -public: - ReadAudioOutputAudioOutputList() : ModelCommand("read") - { - AddArgument("attr-name", "audio-output-list"); - ModelCommand::AddArguments(); - } - - ~ReadAudioOutputAudioOutputList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050B) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::AudioOutputCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse( - void * context, - const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "AudioOutput.AudioOutputList response", value); - } -}; - -class ReportAudioOutputAudioOutputList : public ModelCommand -{ -public: - ReportAudioOutputAudioOutputList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "audio-output-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportAudioOutputAudioOutputList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050B) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::AudioOutputCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport( - void * context, - const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("AudioOutput.AudioOutputList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute CurrentAudioOutput - */ -class ReadAudioOutputCurrentAudioOutput : public ModelCommand -{ -public: - ReadAudioOutputCurrentAudioOutput() : ModelCommand("read") - { - AddArgument("attr-name", "current-audio-output"); - ModelCommand::AddArguments(); - } - - ~ReadAudioOutputCurrentAudioOutput() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050B) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::AudioOutputCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "AudioOutput.CurrentAudioOutput response", value); - } -}; - -class ReportAudioOutputCurrentAudioOutput : public ModelCommand -{ -public: - ReportAudioOutputCurrentAudioOutput() : ModelCommand("subscribe") - { - AddArgument("attr-name", "current-audio-output"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportAudioOutputCurrentAudioOutput() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050B) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::AudioOutputCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("AudioOutput.CurrentAudioOutput report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadAudioOutputAttributeList : public ModelCommand -{ -public: - ReadAudioOutputAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadAudioOutputAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050B) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::AudioOutputCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "AudioOutput.AttributeList response", value); - } -}; - -class ReportAudioOutputAttributeList : public ModelCommand -{ -public: - ReportAudioOutputAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportAudioOutputAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050B) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::AudioOutputCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("AudioOutput.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadAudioOutputClusterRevision : public ModelCommand -{ -public: - ReadAudioOutputClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadAudioOutputClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050B) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::AudioOutputCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "AudioOutput.ClusterRevision response", value); - } -}; - -class ReportAudioOutputClusterRevision : public ModelCommand -{ -public: - ReportAudioOutputClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportAudioOutputClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050B) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::AudioOutputCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("AudioOutput.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster BarrierControl | 0x0103 | -|------------------------------------------------------------------------------| -| Commands: | | -| * BarrierControlGoToPercent | 0x00 | -| * BarrierControlStop | 0x01 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * BarrierMovingState | 0x0001 | -| * BarrierSafetyStatus | 0x0002 | -| * BarrierCapabilities | 0x0003 | -| * BarrierPosition | 0x000A | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command BarrierControlGoToPercent - */ -class BarrierControlBarrierControlGoToPercent : public ModelCommand -{ -public: - BarrierControlBarrierControlGoToPercent() : ModelCommand("barrier-control-go-to-percent") - { - AddArgument("PercentOpen", 0, UINT8_MAX, &mRequest.percentOpen); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000103) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::BarrierControl::Commands::BarrierControlGoToPercent::Type mRequest; -}; - -/* - * Command BarrierControlStop - */ -class BarrierControlBarrierControlStop : public ModelCommand -{ -public: - BarrierControlBarrierControlStop() : ModelCommand("barrier-control-stop") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000103) command (0x00000001) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::BarrierControl::Commands::BarrierControlStop::Type mRequest; -}; - -/* - * Attribute BarrierMovingState - */ -class ReadBarrierControlBarrierMovingState : public ModelCommand -{ -public: - ReadBarrierControlBarrierMovingState() : ModelCommand("read") - { - AddArgument("attr-name", "barrier-moving-state"); - ModelCommand::AddArguments(); - } - - ~ReadBarrierControlBarrierMovingState() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::BarrierControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "BarrierControl.BarrierMovingState response", value); - } -}; - -class ReportBarrierControlBarrierMovingState : public ModelCommand -{ -public: - ReportBarrierControlBarrierMovingState() : ModelCommand("subscribe") - { - AddArgument("attr-name", "barrier-moving-state"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBarrierControlBarrierMovingState() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::BarrierControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("BarrierControl.BarrierMovingState report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute BarrierSafetyStatus - */ -class ReadBarrierControlBarrierSafetyStatus : public ModelCommand -{ -public: - ReadBarrierControlBarrierSafetyStatus() : ModelCommand("read") - { - AddArgument("attr-name", "barrier-safety-status"); - ModelCommand::AddArguments(); - } - - ~ReadBarrierControlBarrierSafetyStatus() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::BarrierControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "BarrierControl.BarrierSafetyStatus response", value); - } -}; - -class ReportBarrierControlBarrierSafetyStatus : public ModelCommand -{ -public: - ReportBarrierControlBarrierSafetyStatus() : ModelCommand("subscribe") - { - AddArgument("attr-name", "barrier-safety-status"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBarrierControlBarrierSafetyStatus() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::BarrierControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("BarrierControl.BarrierSafetyStatus report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute BarrierCapabilities - */ -class ReadBarrierControlBarrierCapabilities : public ModelCommand -{ -public: - ReadBarrierControlBarrierCapabilities() : ModelCommand("read") - { - AddArgument("attr-name", "barrier-capabilities"); - ModelCommand::AddArguments(); - } - - ~ReadBarrierControlBarrierCapabilities() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::BarrierControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "BarrierControl.BarrierCapabilities response", value); - } -}; - -class ReportBarrierControlBarrierCapabilities : public ModelCommand -{ -public: - ReportBarrierControlBarrierCapabilities() : ModelCommand("subscribe") - { - AddArgument("attr-name", "barrier-capabilities"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBarrierControlBarrierCapabilities() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::BarrierControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("BarrierControl.BarrierCapabilities report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute BarrierPosition - */ -class ReadBarrierControlBarrierPosition : public ModelCommand -{ -public: - ReadBarrierControlBarrierPosition() : ModelCommand("read") - { - AddArgument("attr-name", "barrier-position"); - ModelCommand::AddArguments(); - } - - ~ReadBarrierControlBarrierPosition() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReadAttribute (0x0000000A) on endpoint %" PRIu16, endpointId); - - chip::Controller::BarrierControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "BarrierControl.BarrierPosition response", value); - } -}; - -class ReportBarrierControlBarrierPosition : public ModelCommand -{ -public: - ReportBarrierControlBarrierPosition() : ModelCommand("subscribe") - { - AddArgument("attr-name", "barrier-position"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBarrierControlBarrierPosition() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReportAttribute (0x0000000A) on endpoint %" PRIu16, endpointId); - - chip::Controller::BarrierControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("BarrierControl.BarrierPosition report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadBarrierControlAttributeList : public ModelCommand -{ -public: - ReadBarrierControlAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadBarrierControlAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::BarrierControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "BarrierControl.AttributeList response", value); - } -}; - -class ReportBarrierControlAttributeList : public ModelCommand -{ -public: - ReportBarrierControlAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBarrierControlAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::BarrierControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("BarrierControl.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadBarrierControlClusterRevision : public ModelCommand -{ -public: - ReadBarrierControlClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadBarrierControlClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::BarrierControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "BarrierControl.ClusterRevision response", value); - } -}; - -class ReportBarrierControlClusterRevision : public ModelCommand -{ -public: - ReportBarrierControlClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBarrierControlClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000103) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::BarrierControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("BarrierControl.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster Basic | 0x0028 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * InteractionModelVersion | 0x0000 | -| * VendorName | 0x0001 | -| * VendorID | 0x0002 | -| * ProductName | 0x0003 | -| * ProductID | 0x0004 | -| * NodeLabel | 0x0005 | -| * Location | 0x0006 | -| * HardwareVersion | 0x0007 | -| * HardwareVersionString | 0x0008 | -| * SoftwareVersion | 0x0009 | -| * SoftwareVersionString | 0x000A | -| * ManufacturingDate | 0x000B | -| * PartNumber | 0x000C | -| * ProductURL | 0x000D | -| * ProductLabel | 0x000E | -| * SerialNumber | 0x000F | -| * LocalConfigDisabled | 0x0010 | -| * Reachable | 0x0011 | -| * UniqueID | 0x0012 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -| * StartUp | 0x0000 | -| * ShutDown | 0x0001 | -| * Leave | 0x0002 | -| * ReachableChanged | 0x0003 | -\*----------------------------------------------------------------------------*/ - -/* - * Event StartUp - */ -class ReadBasicStartUp : public ModelCommand -{ -public: - ReadBasicStartUp() : ModelCommand("read-event") - { - AddArgument("event-name", "start-up"); - ModelCommand::AddArguments(); - } - - ~ReadBasicStartUp() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadEvent (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent(this, OnEventResponse, - OnDefaultFailure); - } - - static void OnEventResponse(void * context, chip::app::Clusters::Basic::Events::StartUp::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "Basic.StartUp response", value); - } -}; - -class ReportBasicStartUp : public ModelCommand -{ -public: - ReportBasicStartUp() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "start-up"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBasicStartUp() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportEvent (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::Basic::Events::StartUp::DecodableType value) - { - DataModelLogger::LogValue("Basic.StartUp report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event ShutDown - */ -class ReadBasicShutDown : public ModelCommand -{ -public: - ReadBasicShutDown() : ModelCommand("read-event") - { - AddArgument("event-name", "shut-down"); - ModelCommand::AddArguments(); - } - - ~ReadBasicShutDown() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadEvent (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent(this, OnEventResponse, - OnDefaultFailure); - } - - static void OnEventResponse(void * context, chip::app::Clusters::Basic::Events::ShutDown::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "Basic.ShutDown response", value); - } -}; - -class ReportBasicShutDown : public ModelCommand -{ -public: - ReportBasicShutDown() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "shut-down"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBasicShutDown() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportEvent (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::Basic::Events::ShutDown::DecodableType value) - { - DataModelLogger::LogValue("Basic.ShutDown report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event Leave - */ -class ReadBasicLeave : public ModelCommand -{ -public: - ReadBasicLeave() : ModelCommand("read-event") - { - AddArgument("event-name", "leave"); - ModelCommand::AddArguments(); - } - - ~ReadBasicLeave() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadEvent (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent(this, OnEventResponse, OnDefaultFailure); - } - - static void OnEventResponse(void * context, chip::app::Clusters::Basic::Events::Leave::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "Basic.Leave response", value); - } -}; - -class ReportBasicLeave : public ModelCommand -{ -public: - ReportBasicLeave() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "leave"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBasicLeave() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportEvent (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::Basic::Events::Leave::DecodableType value) - { - DataModelLogger::LogValue("Basic.Leave report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event ReachableChanged - */ -class ReadBasicReachableChanged : public ModelCommand -{ -public: - ReadBasicReachableChanged() : ModelCommand("read-event") - { - AddArgument("event-name", "reachable-changed"); - ModelCommand::AddArguments(); - } - - ~ReadBasicReachableChanged() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadEvent (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent(this, OnEventResponse, - OnDefaultFailure); - } - - static void OnEventResponse(void * context, chip::app::Clusters::Basic::Events::ReachableChanged::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "Basic.ReachableChanged response", value); - } -}; - -class ReportBasicReachableChanged : public ModelCommand -{ -public: - ReportBasicReachableChanged() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "reachable-changed"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBasicReachableChanged() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportEvent (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::Basic::Events::ReachableChanged::DecodableType value) - { - DataModelLogger::LogValue("Basic.ReachableChanged report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute InteractionModelVersion - */ -class ReadBasicInteractionModelVersion : public ModelCommand -{ -public: - ReadBasicInteractionModelVersion() : ModelCommand("read") - { - AddArgument("attr-name", "interaction-model-version"); - ModelCommand::AddArguments(); - } - - ~ReadBasicInteractionModelVersion() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "Basic.InteractionModelVersion response", value); - } -}; - -class ReportBasicInteractionModelVersion : public ModelCommand -{ -public: - ReportBasicInteractionModelVersion() : ModelCommand("subscribe") - { - AddArgument("attr-name", "interaction-model-version"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBasicInteractionModelVersion() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("Basic.InteractionModelVersion report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute VendorName - */ -class ReadBasicVendorName : public ModelCommand -{ -public: - ReadBasicVendorName() : ModelCommand("read") - { - AddArgument("attr-name", "vendor-name"); - ModelCommand::AddArguments(); - } - - ~ReadBasicVendorName() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::CharSpan value) - { - OnGeneralAttributeEventResponse(context, "Basic.VendorName response", value); - } -}; - -class ReportBasicVendorName : public ModelCommand -{ -public: - ReportBasicVendorName() : ModelCommand("subscribe") - { - AddArgument("attr-name", "vendor-name"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBasicVendorName() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::CharSpan value) - { - DataModelLogger::LogValue("Basic.VendorName report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute VendorID - */ -class ReadBasicVendorID : public ModelCommand -{ -public: - ReadBasicVendorID() : ModelCommand("read") - { - AddArgument("attr-name", "vendor-id"); - ModelCommand::AddArguments(); - } - - ~ReadBasicVendorID() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::VendorId value) - { - OnGeneralAttributeEventResponse(context, "Basic.VendorID response", value); - } -}; - -class ReportBasicVendorID : public ModelCommand -{ -public: - ReportBasicVendorID() : ModelCommand("subscribe") - { - AddArgument("attr-name", "vendor-id"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBasicVendorID() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::VendorId value) - { - DataModelLogger::LogValue("Basic.VendorID report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ProductName - */ -class ReadBasicProductName : public ModelCommand -{ -public: - ReadBasicProductName() : ModelCommand("read") - { - AddArgument("attr-name", "product-name"); - ModelCommand::AddArguments(); - } - - ~ReadBasicProductName() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::CharSpan value) - { - OnGeneralAttributeEventResponse(context, "Basic.ProductName response", value); - } -}; - -class ReportBasicProductName : public ModelCommand -{ -public: - ReportBasicProductName() : ModelCommand("subscribe") - { - AddArgument("attr-name", "product-name"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBasicProductName() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::CharSpan value) - { - DataModelLogger::LogValue("Basic.ProductName report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ProductID - */ -class ReadBasicProductID : public ModelCommand -{ -public: - ReadBasicProductID() : ModelCommand("read") - { - AddArgument("attr-name", "product-id"); - ModelCommand::AddArguments(); - } - - ~ReadBasicProductID() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "Basic.ProductID response", value); - } -}; - -class ReportBasicProductID : public ModelCommand -{ -public: - ReportBasicProductID() : ModelCommand("subscribe") - { - AddArgument("attr-name", "product-id"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBasicProductID() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) { DataModelLogger::LogValue("Basic.ProductID report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NodeLabel - */ -class ReadBasicNodeLabel : public ModelCommand -{ -public: - ReadBasicNodeLabel() : ModelCommand("read") - { - AddArgument("attr-name", "node-label"); - ModelCommand::AddArguments(); - } - - ~ReadBasicNodeLabel() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::CharSpan value) - { - OnGeneralAttributeEventResponse(context, "Basic.NodeLabel response", value); - } -}; - -class WriteBasicNodeLabel : public ModelCommand -{ -public: - WriteBasicNodeLabel() : ModelCommand("write") - { - AddArgument("attr-name", "node-label"); - AddArgument("attr-value", &mValue); - ModelCommand::AddArguments(); - } - - ~WriteBasicNodeLabel() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) WriteAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::CharSpan mValue; -}; - -class ReportBasicNodeLabel : public ModelCommand -{ -public: - ReportBasicNodeLabel() : ModelCommand("subscribe") - { - AddArgument("attr-name", "node-label"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBasicNodeLabel() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::CharSpan value) - { - DataModelLogger::LogValue("Basic.NodeLabel report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Location - */ -class ReadBasicLocation : public ModelCommand -{ -public: - ReadBasicLocation() : ModelCommand("read") - { - AddArgument("attr-name", "location"); - ModelCommand::AddArguments(); - } - - ~ReadBasicLocation() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::CharSpan value) - { - OnGeneralAttributeEventResponse(context, "Basic.Location response", value); - } -}; - -class WriteBasicLocation : public ModelCommand -{ -public: - WriteBasicLocation() : ModelCommand("write") - { - AddArgument("attr-name", "location"); - AddArgument("attr-value", &mValue); - ModelCommand::AddArguments(); - } - - ~WriteBasicLocation() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) WriteAttribute (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::CharSpan mValue; -}; - -class ReportBasicLocation : public ModelCommand -{ -public: - ReportBasicLocation() : ModelCommand("subscribe") - { - AddArgument("attr-name", "location"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBasicLocation() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::CharSpan value) - { - DataModelLogger::LogValue("Basic.Location report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute HardwareVersion - */ -class ReadBasicHardwareVersion : public ModelCommand -{ -public: - ReadBasicHardwareVersion() : ModelCommand("read") - { - AddArgument("attr-name", "hardware-version"); - ModelCommand::AddArguments(); - } - - ~ReadBasicHardwareVersion() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000007) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "Basic.HardwareVersion response", value); - } -}; - -class ReportBasicHardwareVersion : public ModelCommand -{ -public: - ReportBasicHardwareVersion() : ModelCommand("subscribe") - { - AddArgument("attr-name", "hardware-version"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBasicHardwareVersion() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000007) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("Basic.HardwareVersion report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute HardwareVersionString - */ -class ReadBasicHardwareVersionString : public ModelCommand -{ -public: - ReadBasicHardwareVersionString() : ModelCommand("read") - { - AddArgument("attr-name", "hardware-version-string"); - ModelCommand::AddArguments(); - } - - ~ReadBasicHardwareVersionString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000008) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::CharSpan value) - { - OnGeneralAttributeEventResponse(context, "Basic.HardwareVersionString response", value); - } -}; - -class ReportBasicHardwareVersionString : public ModelCommand -{ -public: - ReportBasicHardwareVersionString() : ModelCommand("subscribe") - { - AddArgument("attr-name", "hardware-version-string"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBasicHardwareVersionString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000008) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::CharSpan value) - { - DataModelLogger::LogValue("Basic.HardwareVersionString report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute SoftwareVersion - */ -class ReadBasicSoftwareVersion : public ModelCommand -{ -public: - ReadBasicSoftwareVersion() : ModelCommand("read") - { - AddArgument("attr-name", "software-version"); - ModelCommand::AddArguments(); - } - - ~ReadBasicSoftwareVersion() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000009) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint32_t value) - { - OnGeneralAttributeEventResponse(context, "Basic.SoftwareVersion response", value); - } -}; - -class ReportBasicSoftwareVersion : public ModelCommand -{ -public: - ReportBasicSoftwareVersion() : ModelCommand("subscribe") - { - AddArgument("attr-name", "software-version"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBasicSoftwareVersion() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000009) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint32_t value) - { - DataModelLogger::LogValue("Basic.SoftwareVersion report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute SoftwareVersionString - */ -class ReadBasicSoftwareVersionString : public ModelCommand -{ -public: - ReadBasicSoftwareVersionString() : ModelCommand("read") - { - AddArgument("attr-name", "software-version-string"); - ModelCommand::AddArguments(); - } - - ~ReadBasicSoftwareVersionString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x0000000A) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::CharSpan value) - { - OnGeneralAttributeEventResponse(context, "Basic.SoftwareVersionString response", value); - } -}; - -class ReportBasicSoftwareVersionString : public ModelCommand -{ -public: - ReportBasicSoftwareVersionString() : ModelCommand("subscribe") - { - AddArgument("attr-name", "software-version-string"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBasicSoftwareVersionString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x0000000A) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::CharSpan value) - { - DataModelLogger::LogValue("Basic.SoftwareVersionString report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ManufacturingDate - */ -class ReadBasicManufacturingDate : public ModelCommand -{ -public: - ReadBasicManufacturingDate() : ModelCommand("read") - { - AddArgument("attr-name", "manufacturing-date"); - ModelCommand::AddArguments(); - } - - ~ReadBasicManufacturingDate() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x0000000B) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::CharSpan value) - { - OnGeneralAttributeEventResponse(context, "Basic.ManufacturingDate response", value); - } -}; - -class ReportBasicManufacturingDate : public ModelCommand -{ -public: - ReportBasicManufacturingDate() : ModelCommand("subscribe") - { - AddArgument("attr-name", "manufacturing-date"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBasicManufacturingDate() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x0000000B) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::CharSpan value) - { - DataModelLogger::LogValue("Basic.ManufacturingDate report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute PartNumber - */ -class ReadBasicPartNumber : public ModelCommand -{ -public: - ReadBasicPartNumber() : ModelCommand("read") - { - AddArgument("attr-name", "part-number"); - ModelCommand::AddArguments(); - } - - ~ReadBasicPartNumber() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x0000000C) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::CharSpan value) - { - OnGeneralAttributeEventResponse(context, "Basic.PartNumber response", value); - } -}; - -class ReportBasicPartNumber : public ModelCommand -{ -public: - ReportBasicPartNumber() : ModelCommand("subscribe") - { - AddArgument("attr-name", "part-number"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBasicPartNumber() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x0000000C) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::CharSpan value) - { - DataModelLogger::LogValue("Basic.PartNumber report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ProductURL - */ -class ReadBasicProductURL : public ModelCommand -{ -public: - ReadBasicProductURL() : ModelCommand("read") - { - AddArgument("attr-name", "product-url"); - ModelCommand::AddArguments(); - } - - ~ReadBasicProductURL() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x0000000D) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::CharSpan value) - { - OnGeneralAttributeEventResponse(context, "Basic.ProductURL response", value); - } -}; - -class ReportBasicProductURL : public ModelCommand -{ -public: - ReportBasicProductURL() : ModelCommand("subscribe") - { - AddArgument("attr-name", "product-url"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBasicProductURL() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x0000000D) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::CharSpan value) - { - DataModelLogger::LogValue("Basic.ProductURL report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ProductLabel - */ -class ReadBasicProductLabel : public ModelCommand -{ -public: - ReadBasicProductLabel() : ModelCommand("read") - { - AddArgument("attr-name", "product-label"); - ModelCommand::AddArguments(); - } - - ~ReadBasicProductLabel() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x0000000E) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::CharSpan value) - { - OnGeneralAttributeEventResponse(context, "Basic.ProductLabel response", value); - } -}; - -class ReportBasicProductLabel : public ModelCommand -{ -public: - ReportBasicProductLabel() : ModelCommand("subscribe") - { - AddArgument("attr-name", "product-label"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBasicProductLabel() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x0000000E) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::CharSpan value) - { - DataModelLogger::LogValue("Basic.ProductLabel report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute SerialNumber - */ -class ReadBasicSerialNumber : public ModelCommand -{ -public: - ReadBasicSerialNumber() : ModelCommand("read") - { - AddArgument("attr-name", "serial-number"); - ModelCommand::AddArguments(); - } - - ~ReadBasicSerialNumber() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x0000000F) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::CharSpan value) - { - OnGeneralAttributeEventResponse(context, "Basic.SerialNumber response", value); - } -}; - -class ReportBasicSerialNumber : public ModelCommand -{ -public: - ReportBasicSerialNumber() : ModelCommand("subscribe") - { - AddArgument("attr-name", "serial-number"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBasicSerialNumber() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x0000000F) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::CharSpan value) - { - DataModelLogger::LogValue("Basic.SerialNumber report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute LocalConfigDisabled - */ -class ReadBasicLocalConfigDisabled : public ModelCommand -{ -public: - ReadBasicLocalConfigDisabled() : ModelCommand("read") - { - AddArgument("attr-name", "local-config-disabled"); - ModelCommand::AddArguments(); - } - - ~ReadBasicLocalConfigDisabled() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000010) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, bool value) - { - OnGeneralAttributeEventResponse(context, "Basic.LocalConfigDisabled response", value); - } -}; - -class WriteBasicLocalConfigDisabled : public ModelCommand -{ -public: - WriteBasicLocalConfigDisabled() : ModelCommand("write") - { - AddArgument("attr-name", "local-config-disabled"); - AddArgument("attr-value", 0, 1, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteBasicLocalConfigDisabled() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) WriteAttribute (0x00000010) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - bool mValue; -}; - -class ReportBasicLocalConfigDisabled : public ModelCommand -{ -public: - ReportBasicLocalConfigDisabled() : ModelCommand("subscribe") - { - AddArgument("attr-name", "local-config-disabled"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBasicLocalConfigDisabled() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000010) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, bool value) - { - DataModelLogger::LogValue("Basic.LocalConfigDisabled report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Reachable - */ -class ReadBasicReachable : public ModelCommand -{ -public: - ReadBasicReachable() : ModelCommand("read") - { - AddArgument("attr-name", "reachable"); - ModelCommand::AddArguments(); - } - - ~ReadBasicReachable() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000011) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, bool value) - { - OnGeneralAttributeEventResponse(context, "Basic.Reachable response", value); - } -}; - -class ReportBasicReachable : public ModelCommand -{ -public: - ReportBasicReachable() : ModelCommand("subscribe") - { - AddArgument("attr-name", "reachable"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBasicReachable() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000011) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, bool value) { DataModelLogger::LogValue("Basic.Reachable report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute UniqueID - */ -class ReadBasicUniqueID : public ModelCommand -{ -public: - ReadBasicUniqueID() : ModelCommand("read") - { - AddArgument("attr-name", "unique-id"); - ModelCommand::AddArguments(); - } - - ~ReadBasicUniqueID() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x00000012) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::CharSpan value) - { - OnGeneralAttributeEventResponse(context, "Basic.UniqueID response", value); - } -}; - -class ReportBasicUniqueID : public ModelCommand -{ -public: - ReportBasicUniqueID() : ModelCommand("subscribe") - { - AddArgument("attr-name", "unique-id"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBasicUniqueID() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x00000012) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::CharSpan value) - { - DataModelLogger::LogValue("Basic.UniqueID report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadBasicAttributeList : public ModelCommand -{ -public: - ReadBasicAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadBasicAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "Basic.AttributeList response", value); - } -}; - -class ReportBasicAttributeList : public ModelCommand -{ -public: - ReportBasicAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBasicAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("Basic.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadBasicClusterRevision : public ModelCommand -{ -public: - ReadBasicClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadBasicClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "Basic.ClusterRevision response", value); - } -}; - -class ReportBasicClusterRevision : public ModelCommand -{ -public: - ReportBasicClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBasicClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000028) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("Basic.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster BinaryInputBasic | 0x000F | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * OutOfService | 0x0051 | -| * PresentValue | 0x0055 | -| * StatusFlags | 0x006F | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Attribute OutOfService - */ -class ReadBinaryInputBasicOutOfService : public ModelCommand -{ -public: - ReadBinaryInputBasicOutOfService() : ModelCommand("read") - { - AddArgument("attr-name", "out-of-service"); - ModelCommand::AddArguments(); - } - - ~ReadBinaryInputBasicOutOfService() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x00000051) on endpoint %" PRIu16, endpointId); - - chip::Controller::BinaryInputBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, bool value) - { - OnGeneralAttributeEventResponse(context, "BinaryInputBasic.OutOfService response", value); - } -}; - -class WriteBinaryInputBasicOutOfService : public ModelCommand -{ -public: - WriteBinaryInputBasicOutOfService() : ModelCommand("write") - { - AddArgument("attr-name", "out-of-service"); - AddArgument("attr-value", 0, 1, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteBinaryInputBasicOutOfService() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) WriteAttribute (0x00000051) on endpoint %" PRIu16, endpointId); - - chip::Controller::BinaryInputBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - bool mValue; -}; - -class ReportBinaryInputBasicOutOfService : public ModelCommand -{ -public: - ReportBinaryInputBasicOutOfService() : ModelCommand("subscribe") - { - AddArgument("attr-name", "out-of-service"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBinaryInputBasicOutOfService() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x00000051) on endpoint %" PRIu16, endpointId); - - chip::Controller::BinaryInputBasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, bool value) - { - DataModelLogger::LogValue("BinaryInputBasic.OutOfService report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute PresentValue - */ -class ReadBinaryInputBasicPresentValue : public ModelCommand -{ -public: - ReadBinaryInputBasicPresentValue() : ModelCommand("read") - { - AddArgument("attr-name", "present-value"); - ModelCommand::AddArguments(); - } - - ~ReadBinaryInputBasicPresentValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x00000055) on endpoint %" PRIu16, endpointId); - - chip::Controller::BinaryInputBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, bool value) - { - OnGeneralAttributeEventResponse(context, "BinaryInputBasic.PresentValue response", value); - } -}; - -class WriteBinaryInputBasicPresentValue : public ModelCommand -{ -public: - WriteBinaryInputBasicPresentValue() : ModelCommand("write") - { - AddArgument("attr-name", "present-value"); - AddArgument("attr-value", 0, 1, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteBinaryInputBasicPresentValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) WriteAttribute (0x00000055) on endpoint %" PRIu16, endpointId); - - chip::Controller::BinaryInputBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - bool mValue; -}; - -class ReportBinaryInputBasicPresentValue : public ModelCommand -{ -public: - ReportBinaryInputBasicPresentValue() : ModelCommand("subscribe") - { - AddArgument("attr-name", "present-value"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBinaryInputBasicPresentValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x00000055) on endpoint %" PRIu16, endpointId); - - chip::Controller::BinaryInputBasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, bool value) - { - DataModelLogger::LogValue("BinaryInputBasic.PresentValue report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute StatusFlags - */ -class ReadBinaryInputBasicStatusFlags : public ModelCommand -{ -public: - ReadBinaryInputBasicStatusFlags() : ModelCommand("read") - { - AddArgument("attr-name", "status-flags"); - ModelCommand::AddArguments(); - } - - ~ReadBinaryInputBasicStatusFlags() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x0000006F) on endpoint %" PRIu16, endpointId); - - chip::Controller::BinaryInputBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "BinaryInputBasic.StatusFlags response", value); - } -}; - -class ReportBinaryInputBasicStatusFlags : public ModelCommand -{ -public: - ReportBinaryInputBasicStatusFlags() : ModelCommand("subscribe") - { - AddArgument("attr-name", "status-flags"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBinaryInputBasicStatusFlags() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x0000006F) on endpoint %" PRIu16, endpointId); - - chip::Controller::BinaryInputBasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("BinaryInputBasic.StatusFlags report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadBinaryInputBasicAttributeList : public ModelCommand -{ -public: - ReadBinaryInputBasicAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadBinaryInputBasicAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::BinaryInputBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "BinaryInputBasic.AttributeList response", value); - } -}; - -class ReportBinaryInputBasicAttributeList : public ModelCommand -{ -public: - ReportBinaryInputBasicAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBinaryInputBasicAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::BinaryInputBasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("BinaryInputBasic.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadBinaryInputBasicClusterRevision : public ModelCommand -{ -public: - ReadBinaryInputBasicClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadBinaryInputBasicClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::BinaryInputBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "BinaryInputBasic.ClusterRevision response", value); - } -}; - -class ReportBinaryInputBasicClusterRevision : public ModelCommand -{ -public: - ReportBinaryInputBasicClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBinaryInputBasicClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000000F) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::BinaryInputBasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("BinaryInputBasic.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster Binding | 0x001E | -|------------------------------------------------------------------------------| -| Commands: | | -| * Bind | 0x00 | -| * Unbind | 0x01 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command Bind - */ -class BindingBind : public ModelCommand -{ -public: - BindingBind() : ModelCommand("bind") - { - AddArgument("NodeId", 0, UINT64_MAX, &mRequest.nodeId); - AddArgument("GroupId", 0, UINT16_MAX, &mRequest.groupId); - AddArgument("EndpointId", 0, UINT16_MAX, &mRequest.endpointId); - AddArgument("ClusterId", 0, UINT32_MAX, &mRequest.clusterId); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001E) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Binding::Commands::Bind::Type mRequest; -}; - -/* - * Command Unbind - */ -class BindingUnbind : public ModelCommand -{ -public: - BindingUnbind() : ModelCommand("unbind") - { - AddArgument("NodeId", 0, UINT64_MAX, &mRequest.nodeId); - AddArgument("GroupId", 0, UINT16_MAX, &mRequest.groupId); - AddArgument("EndpointId", 0, UINT16_MAX, &mRequest.endpointId); - AddArgument("ClusterId", 0, UINT32_MAX, &mRequest.clusterId); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001E) command (0x00000001) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Binding::Commands::Unbind::Type mRequest; -}; - -/* - * Attribute AttributeList - */ -class ReadBindingAttributeList : public ModelCommand -{ -public: - ReadBindingAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadBindingAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::BindingCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "Binding.AttributeList response", value); - } -}; - -class ReportBindingAttributeList : public ModelCommand -{ -public: - ReportBindingAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBindingAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::BindingCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("Binding.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadBindingClusterRevision : public ModelCommand -{ -public: - ReadBindingClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadBindingClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::BindingCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "Binding.ClusterRevision response", value); - } -}; - -class ReportBindingClusterRevision : public ModelCommand -{ -public: - ReportBindingClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBindingClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001E) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::BindingCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("Binding.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster BooleanState | 0x0045 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * StateValue | 0x0000 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -| * StateChange | 0x0000 | -\*----------------------------------------------------------------------------*/ - -/* - * Event StateChange - */ -class ReadBooleanStateStateChange : public ModelCommand -{ -public: - ReadBooleanStateStateChange() : ModelCommand("read-event") - { - AddArgument("event-name", "state-change"); - ModelCommand::AddArguments(); - } - - ~ReadBooleanStateStateChange() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReadEvent (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::BooleanStateCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent(this, OnEventResponse, - OnDefaultFailure); - } - - static void OnEventResponse(void * context, chip::app::Clusters::BooleanState::Events::StateChange::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "BooleanState.StateChange response", value); - } -}; - -class ReportBooleanStateStateChange : public ModelCommand -{ -public: - ReportBooleanStateStateChange() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "state-change"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBooleanStateStateChange() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReportEvent (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::BooleanStateCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::BooleanState::Events::StateChange::DecodableType value) - { - DataModelLogger::LogValue("BooleanState.StateChange report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute StateValue - */ -class ReadBooleanStateStateValue : public ModelCommand -{ -public: - ReadBooleanStateStateValue() : ModelCommand("read") - { - AddArgument("attr-name", "state-value"); - ModelCommand::AddArguments(); - } - - ~ReadBooleanStateStateValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::BooleanStateCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, bool value) - { - OnGeneralAttributeEventResponse(context, "BooleanState.StateValue response", value); - } -}; - -class ReportBooleanStateStateValue : public ModelCommand -{ -public: - ReportBooleanStateStateValue() : ModelCommand("subscribe") - { - AddArgument("attr-name", "state-value"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBooleanStateStateValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::BooleanStateCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, bool value) { DataModelLogger::LogValue("BooleanState.StateValue report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadBooleanStateAttributeList : public ModelCommand -{ -public: - ReadBooleanStateAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadBooleanStateAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::BooleanStateCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "BooleanState.AttributeList response", value); - } -}; - -class ReportBooleanStateAttributeList : public ModelCommand -{ -public: - ReportBooleanStateAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBooleanStateAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::BooleanStateCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("BooleanState.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadBooleanStateClusterRevision : public ModelCommand -{ -public: - ReadBooleanStateClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadBooleanStateClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::BooleanStateCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "BooleanState.ClusterRevision response", value); - } -}; - -class ReportBooleanStateClusterRevision : public ModelCommand -{ -public: - ReportBooleanStateClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBooleanStateClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000045) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::BooleanStateCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("BooleanState.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster BridgedActions | 0x0025 | -|------------------------------------------------------------------------------| -| Commands: | | -| * DisableAction | 0x0A | -| * DisableActionWithDuration | 0x0B | -| * EnableAction | 0x08 | -| * EnableActionWithDuration | 0x09 | -| * InstantAction | 0x00 | -| * InstantActionWithTransition | 0x01 | -| * PauseAction | 0x05 | -| * PauseActionWithDuration | 0x06 | -| * ResumeAction | 0x07 | -| * StartAction | 0x02 | -| * StartActionWithDuration | 0x03 | -| * StopAction | 0x04 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * ActionList | 0x0000 | -| * EndpointList | 0x0001 | -| * SetupUrl | 0x0002 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -| * StateChanged | 0x0000 | -| * ActionFailed | 0x0001 | -\*----------------------------------------------------------------------------*/ - -/* - * Command DisableAction - */ -class BridgedActionsDisableAction : public ModelCommand -{ -public: - BridgedActionsDisableAction() : ModelCommand("disable-action") - { - AddArgument("ActionID", 0, UINT16_MAX, &mRequest.actionID); - AddArgument("InvokeID", 0, UINT32_MAX, &mRequest.invokeID); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x0000000A) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::BridgedActions::Commands::DisableAction::Type mRequest; -}; - -/* - * Command DisableActionWithDuration - */ -class BridgedActionsDisableActionWithDuration : public ModelCommand -{ -public: - BridgedActionsDisableActionWithDuration() : ModelCommand("disable-action-with-duration") - { - AddArgument("ActionID", 0, UINT16_MAX, &mRequest.actionID); - AddArgument("InvokeID", 0, UINT32_MAX, &mRequest.invokeID); - AddArgument("Duration", 0, UINT32_MAX, &mRequest.duration); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x0000000B) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::BridgedActions::Commands::DisableActionWithDuration::Type mRequest; -}; - -/* - * Command EnableAction - */ -class BridgedActionsEnableAction : public ModelCommand -{ -public: - BridgedActionsEnableAction() : ModelCommand("enable-action") - { - AddArgument("ActionID", 0, UINT16_MAX, &mRequest.actionID); - AddArgument("InvokeID", 0, UINT32_MAX, &mRequest.invokeID); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000008) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::BridgedActions::Commands::EnableAction::Type mRequest; -}; - -/* - * Command EnableActionWithDuration - */ -class BridgedActionsEnableActionWithDuration : public ModelCommand -{ -public: - BridgedActionsEnableActionWithDuration() : ModelCommand("enable-action-with-duration") - { - AddArgument("ActionID", 0, UINT16_MAX, &mRequest.actionID); - AddArgument("InvokeID", 0, UINT32_MAX, &mRequest.invokeID); - AddArgument("Duration", 0, UINT32_MAX, &mRequest.duration); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000009) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::BridgedActions::Commands::EnableActionWithDuration::Type mRequest; -}; - -/* - * Command InstantAction - */ -class BridgedActionsInstantAction : public ModelCommand -{ -public: - BridgedActionsInstantAction() : ModelCommand("instant-action") - { - AddArgument("ActionID", 0, UINT16_MAX, &mRequest.actionID); - AddArgument("InvokeID", 0, UINT32_MAX, &mRequest.invokeID); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::BridgedActions::Commands::InstantAction::Type mRequest; -}; - -/* - * Command InstantActionWithTransition - */ -class BridgedActionsInstantActionWithTransition : public ModelCommand -{ -public: - BridgedActionsInstantActionWithTransition() : ModelCommand("instant-action-with-transition") - { - AddArgument("ActionID", 0, UINT16_MAX, &mRequest.actionID); - AddArgument("InvokeID", 0, UINT32_MAX, &mRequest.invokeID); - AddArgument("TransitionTime", 0, UINT16_MAX, &mRequest.transitionTime); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000001) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::BridgedActions::Commands::InstantActionWithTransition::Type mRequest; -}; - -/* - * Command PauseAction - */ -class BridgedActionsPauseAction : public ModelCommand -{ -public: - BridgedActionsPauseAction() : ModelCommand("pause-action") - { - AddArgument("ActionID", 0, UINT16_MAX, &mRequest.actionID); - AddArgument("InvokeID", 0, UINT32_MAX, &mRequest.invokeID); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000005) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::BridgedActions::Commands::PauseAction::Type mRequest; -}; - -/* - * Command PauseActionWithDuration - */ -class BridgedActionsPauseActionWithDuration : public ModelCommand -{ -public: - BridgedActionsPauseActionWithDuration() : ModelCommand("pause-action-with-duration") - { - AddArgument("ActionID", 0, UINT16_MAX, &mRequest.actionID); - AddArgument("InvokeID", 0, UINT32_MAX, &mRequest.invokeID); - AddArgument("Duration", 0, UINT32_MAX, &mRequest.duration); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000006) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::BridgedActions::Commands::PauseActionWithDuration::Type mRequest; -}; - -/* - * Command ResumeAction - */ -class BridgedActionsResumeAction : public ModelCommand -{ -public: - BridgedActionsResumeAction() : ModelCommand("resume-action") - { - AddArgument("ActionID", 0, UINT16_MAX, &mRequest.actionID); - AddArgument("InvokeID", 0, UINT32_MAX, &mRequest.invokeID); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000007) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::BridgedActions::Commands::ResumeAction::Type mRequest; -}; - -/* - * Command StartAction - */ -class BridgedActionsStartAction : public ModelCommand -{ -public: - BridgedActionsStartAction() : ModelCommand("start-action") - { - AddArgument("ActionID", 0, UINT16_MAX, &mRequest.actionID); - AddArgument("InvokeID", 0, UINT32_MAX, &mRequest.invokeID); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000002) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::BridgedActions::Commands::StartAction::Type mRequest; -}; - -/* - * Command StartActionWithDuration - */ -class BridgedActionsStartActionWithDuration : public ModelCommand -{ -public: - BridgedActionsStartActionWithDuration() : ModelCommand("start-action-with-duration") - { - AddArgument("ActionID", 0, UINT16_MAX, &mRequest.actionID); - AddArgument("InvokeID", 0, UINT32_MAX, &mRequest.invokeID); - AddArgument("Duration", 0, UINT32_MAX, &mRequest.duration); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000003) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::BridgedActions::Commands::StartActionWithDuration::Type mRequest; -}; - -/* - * Command StopAction - */ -class BridgedActionsStopAction : public ModelCommand -{ -public: - BridgedActionsStopAction() : ModelCommand("stop-action") - { - AddArgument("ActionID", 0, UINT16_MAX, &mRequest.actionID); - AddArgument("InvokeID", 0, UINT32_MAX, &mRequest.invokeID); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) command (0x00000004) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::BridgedActions::Commands::StopAction::Type mRequest; -}; - -/* - * Event StateChanged - */ -class ReadBridgedActionsStateChanged : public ModelCommand -{ -public: - ReadBridgedActionsStateChanged() : ModelCommand("read-event") - { - AddArgument("event-name", "state-changed"); - ModelCommand::AddArguments(); - } - - ~ReadBridgedActionsStateChanged() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) ReadEvent (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::BridgedActionsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent(this, OnEventResponse, - OnDefaultFailure); - } - - static void OnEventResponse(void * context, chip::app::Clusters::BridgedActions::Events::StateChanged::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "BridgedActions.StateChanged response", value); - } -}; - -class ReportBridgedActionsStateChanged : public ModelCommand -{ -public: - ReportBridgedActionsStateChanged() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "state-changed"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBridgedActionsStateChanged() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) ReportEvent (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::BridgedActionsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::BridgedActions::Events::StateChanged::DecodableType value) - { - DataModelLogger::LogValue("BridgedActions.StateChanged report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event ActionFailed - */ -class ReadBridgedActionsActionFailed : public ModelCommand -{ -public: - ReadBridgedActionsActionFailed() : ModelCommand("read-event") - { - AddArgument("event-name", "action-failed"); - ModelCommand::AddArguments(); - } - - ~ReadBridgedActionsActionFailed() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) ReadEvent (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::BridgedActionsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent(this, OnEventResponse, - OnDefaultFailure); - } - - static void OnEventResponse(void * context, chip::app::Clusters::BridgedActions::Events::ActionFailed::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "BridgedActions.ActionFailed response", value); - } -}; - -class ReportBridgedActionsActionFailed : public ModelCommand -{ -public: - ReportBridgedActionsActionFailed() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "action-failed"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBridgedActionsActionFailed() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) ReportEvent (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::BridgedActionsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::BridgedActions::Events::ActionFailed::DecodableType value) - { - DataModelLogger::LogValue("BridgedActions.ActionFailed report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ActionList - */ -class ReadBridgedActionsActionList : public ModelCommand -{ -public: - ReadBridgedActionsActionList() : ModelCommand("read") - { - AddArgument("attr-name", "action-list"); - ModelCommand::AddArguments(); - } - - ~ReadBridgedActionsActionList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::BridgedActionsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse( - void * context, - const chip::app::DataModel::DecodableList & - value) - { - OnGeneralAttributeEventResponse(context, "BridgedActions.ActionList response", value); - } -}; - -class ReportBridgedActionsActionList : public ModelCommand -{ -public: - ReportBridgedActionsActionList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "action-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBridgedActionsActionList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::BridgedActionsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport( - void * context, - const chip::app::DataModel::DecodableList & - value) - { - DataModelLogger::LogValue("BridgedActions.ActionList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute EndpointList - */ -class ReadBridgedActionsEndpointList : public ModelCommand -{ -public: - ReadBridgedActionsEndpointList() : ModelCommand("read") - { - AddArgument("attr-name", "endpoint-list"); - ModelCommand::AddArguments(); - } - - ~ReadBridgedActionsEndpointList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::BridgedActionsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse( - void * context, - const chip::app::DataModel::DecodableList & - value) - { - OnGeneralAttributeEventResponse(context, "BridgedActions.EndpointList response", value); - } -}; - -class ReportBridgedActionsEndpointList : public ModelCommand -{ -public: - ReportBridgedActionsEndpointList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "endpoint-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBridgedActionsEndpointList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::BridgedActionsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport( - void * context, - const chip::app::DataModel::DecodableList & - value) - { - DataModelLogger::LogValue("BridgedActions.EndpointList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute SetupUrl - */ -class ReadBridgedActionsSetupUrl : public ModelCommand -{ -public: - ReadBridgedActionsSetupUrl() : ModelCommand("read") - { - AddArgument("attr-name", "setup-url"); - ModelCommand::AddArguments(); - } - - ~ReadBridgedActionsSetupUrl() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::BridgedActionsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::CharSpan value) - { - OnGeneralAttributeEventResponse(context, "BridgedActions.SetupUrl response", value); - } -}; - -class ReportBridgedActionsSetupUrl : public ModelCommand -{ -public: - ReportBridgedActionsSetupUrl() : ModelCommand("subscribe") - { - AddArgument("attr-name", "setup-url"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBridgedActionsSetupUrl() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::BridgedActionsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::CharSpan value) - { - DataModelLogger::LogValue("BridgedActions.SetupUrl report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadBridgedActionsAttributeList : public ModelCommand -{ -public: - ReadBridgedActionsAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadBridgedActionsAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::BridgedActionsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "BridgedActions.AttributeList response", value); - } -}; - -class ReportBridgedActionsAttributeList : public ModelCommand -{ -public: - ReportBridgedActionsAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBridgedActionsAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::BridgedActionsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("BridgedActions.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadBridgedActionsClusterRevision : public ModelCommand -{ -public: - ReadBridgedActionsClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadBridgedActionsClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::BridgedActionsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "BridgedActions.ClusterRevision response", value); - } -}; - -class ReportBridgedActionsClusterRevision : public ModelCommand -{ -public: - ReportBridgedActionsClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBridgedActionsClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000025) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::BridgedActionsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("BridgedActions.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster BridgedDeviceBasic | 0x0039 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Attribute AttributeList - */ -class ReadBridgedDeviceBasicAttributeList : public ModelCommand -{ -public: - ReadBridgedDeviceBasicAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadBridgedDeviceBasicAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000039) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "BridgedDeviceBasic.AttributeList response", value); - } -}; - -class ReportBridgedDeviceBasicAttributeList : public ModelCommand -{ -public: - ReportBridgedDeviceBasicAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBridgedDeviceBasicAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000039) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("BridgedDeviceBasic.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadBridgedDeviceBasicClusterRevision : public ModelCommand -{ -public: - ReadBridgedDeviceBasicClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadBridgedDeviceBasicClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000039) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "BridgedDeviceBasic.ClusterRevision response", value); - } -}; - -class ReportBridgedDeviceBasicClusterRevision : public ModelCommand -{ -public: - ReportBridgedDeviceBasicClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportBridgedDeviceBasicClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000039) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::BridgedDeviceBasicCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("BridgedDeviceBasic.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster Channel | 0x0504 | -|------------------------------------------------------------------------------| -| Commands: | | -| * ChangeChannelByNumberRequest | 0x02 | -| * ChangeChannelRequest | 0x00 | -| * SkipChannelRequest | 0x03 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * ChannelList | 0x0000 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command ChangeChannelByNumberRequest - */ -class ChannelChangeChannelByNumberRequest : public ModelCommand -{ -public: - ChannelChangeChannelByNumberRequest() : ModelCommand("change-channel-by-number-request") - { - AddArgument("MajorNumber", 0, UINT16_MAX, &mRequest.majorNumber); - AddArgument("MinorNumber", 0, UINT16_MAX, &mRequest.minorNumber); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000504) command (0x00000002) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Channel::Commands::ChangeChannelByNumberRequest::Type mRequest; -}; - -/* - * Command ChangeChannelRequest - */ -class ChannelChangeChannelRequest : public ModelCommand -{ -public: - ChannelChangeChannelRequest() : ModelCommand("change-channel-request") - { - AddArgument("Match", &mRequest.match); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000504) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnChannelChangeChannelResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Channel::Commands::ChangeChannelRequest::Type mRequest; -}; - -/* - * Command SkipChannelRequest - */ -class ChannelSkipChannelRequest : public ModelCommand -{ -public: - ChannelSkipChannelRequest() : ModelCommand("skip-channel-request") - { - AddArgument("Count", 0, UINT16_MAX, &mRequest.count); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000504) command (0x00000003) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Channel::Commands::SkipChannelRequest::Type mRequest; -}; - -/* - * Attribute ChannelList - */ -class ReadChannelChannelList : public ModelCommand -{ -public: - ReadChannelChannelList() : ModelCommand("read") - { - AddArgument("attr-name", "channel-list"); - ModelCommand::AddArguments(); - } - - ~ReadChannelChannelList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000504) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::ChannelCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse( - void * context, - const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "Channel.ChannelList response", value); - } -}; - -class ReportChannelChannelList : public ModelCommand -{ -public: - ReportChannelChannelList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "channel-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportChannelChannelList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000504) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::ChannelCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport( - void * context, - const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("Channel.ChannelList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadChannelAttributeList : public ModelCommand -{ -public: - ReadChannelAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadChannelAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000504) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::ChannelCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "Channel.AttributeList response", value); - } -}; - -class ReportChannelAttributeList : public ModelCommand -{ -public: - ReportChannelAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportChannelAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000504) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::ChannelCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("Channel.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadChannelClusterRevision : public ModelCommand -{ -public: - ReadChannelClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadChannelClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000504) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::ChannelCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "Channel.ClusterRevision response", value); - } -}; - -class ReportChannelClusterRevision : public ModelCommand -{ -public: - ReportChannelClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportChannelClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000504) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::ChannelCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("Channel.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster ColorControl | 0x0300 | -|------------------------------------------------------------------------------| -| Commands: | | -| * ColorLoopSet | 0x44 | -| * EnhancedMoveHue | 0x41 | -| * EnhancedMoveToHue | 0x40 | -| * EnhancedMoveToHueAndSaturation | 0x43 | -| * EnhancedStepHue | 0x42 | -| * MoveColor | 0x08 | -| * MoveColorTemperature | 0x4B | -| * MoveHue | 0x01 | -| * MoveSaturation | 0x04 | -| * MoveToColor | 0x07 | -| * MoveToColorTemperature | 0x0A | -| * MoveToHue | 0x00 | -| * MoveToHueAndSaturation | 0x06 | -| * MoveToSaturation | 0x03 | -| * StepColor | 0x09 | -| * StepColorTemperature | 0x4C | -| * StepHue | 0x02 | -| * StepSaturation | 0x05 | -| * StopMoveStep | 0x47 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * CurrentHue | 0x0000 | -| * CurrentSaturation | 0x0001 | -| * RemainingTime | 0x0002 | -| * CurrentX | 0x0003 | -| * CurrentY | 0x0004 | -| * DriftCompensation | 0x0005 | -| * CompensationText | 0x0006 | -| * ColorTemperature | 0x0007 | -| * ColorMode | 0x0008 | -| * ColorControlOptions | 0x000F | -| * NumberOfPrimaries | 0x0010 | -| * Primary1X | 0x0011 | -| * Primary1Y | 0x0012 | -| * Primary1Intensity | 0x0013 | -| * Primary2X | 0x0015 | -| * Primary2Y | 0x0016 | -| * Primary2Intensity | 0x0017 | -| * Primary3X | 0x0019 | -| * Primary3Y | 0x001A | -| * Primary3Intensity | 0x001B | -| * Primary4X | 0x0020 | -| * Primary4Y | 0x0021 | -| * Primary4Intensity | 0x0022 | -| * Primary5X | 0x0024 | -| * Primary5Y | 0x0025 | -| * Primary5Intensity | 0x0026 | -| * Primary6X | 0x0028 | -| * Primary6Y | 0x0029 | -| * Primary6Intensity | 0x002A | -| * WhitePointX | 0x0030 | -| * WhitePointY | 0x0031 | -| * ColorPointRX | 0x0032 | -| * ColorPointRY | 0x0033 | -| * ColorPointRIntensity | 0x0034 | -| * ColorPointGX | 0x0036 | -| * ColorPointGY | 0x0037 | -| * ColorPointGIntensity | 0x0038 | -| * ColorPointBX | 0x003A | -| * ColorPointBY | 0x003B | -| * ColorPointBIntensity | 0x003C | -| * EnhancedCurrentHue | 0x4000 | -| * EnhancedColorMode | 0x4001 | -| * ColorLoopActive | 0x4002 | -| * ColorLoopDirection | 0x4003 | -| * ColorLoopTime | 0x4004 | -| * ColorLoopStartEnhancedHue | 0x4005 | -| * ColorLoopStoredEnhancedHue | 0x4006 | -| * ColorCapabilities | 0x400A | -| * ColorTempPhysicalMin | 0x400B | -| * ColorTempPhysicalMax | 0x400C | -| * CoupleColorTempToLevelMinMireds | 0x400D | -| * StartUpColorTemperatureMireds | 0x4010 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command ColorLoopSet - */ -class ColorControlColorLoopSet : public ModelCommand -{ -public: - ColorControlColorLoopSet() : ModelCommand("color-loop-set") - { - AddArgument("UpdateFlags", 0, UINT8_MAX, - reinterpret_cast *>( - &mRequest.updateFlags)); - AddArgument("Action", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.action)); - AddArgument("Direction", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.direction)); - AddArgument("Time", 0, UINT16_MAX, &mRequest.time); - AddArgument("StartHue", 0, UINT16_MAX, &mRequest.startHue); - AddArgument("OptionsMask", 0, UINT8_MAX, &mRequest.optionsMask); - AddArgument("OptionsOverride", 0, UINT8_MAX, &mRequest.optionsOverride); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000044) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type mRequest; -}; - -/* - * Command EnhancedMoveHue - */ -class ColorControlEnhancedMoveHue : public ModelCommand -{ -public: - ColorControlEnhancedMoveHue() : ModelCommand("enhanced-move-hue") - { - AddArgument("MoveMode", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.moveMode)); - AddArgument("Rate", 0, UINT16_MAX, &mRequest.rate); - AddArgument("OptionsMask", 0, UINT8_MAX, &mRequest.optionsMask); - AddArgument("OptionsOverride", 0, UINT8_MAX, &mRequest.optionsOverride); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000041) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type mRequest; -}; - -/* - * Command EnhancedMoveToHue - */ -class ColorControlEnhancedMoveToHue : public ModelCommand -{ -public: - ColorControlEnhancedMoveToHue() : ModelCommand("enhanced-move-to-hue") - { - AddArgument("EnhancedHue", 0, UINT16_MAX, &mRequest.enhancedHue); - AddArgument("Direction", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.direction)); - AddArgument("TransitionTime", 0, UINT16_MAX, &mRequest.transitionTime); - AddArgument("OptionsMask", 0, UINT8_MAX, &mRequest.optionsMask); - AddArgument("OptionsOverride", 0, UINT8_MAX, &mRequest.optionsOverride); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000040) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type mRequest; -}; - -/* - * Command EnhancedMoveToHueAndSaturation - */ -class ColorControlEnhancedMoveToHueAndSaturation : public ModelCommand -{ -public: - ColorControlEnhancedMoveToHueAndSaturation() : ModelCommand("enhanced-move-to-hue-and-saturation") - { - AddArgument("EnhancedHue", 0, UINT16_MAX, &mRequest.enhancedHue); - AddArgument("Saturation", 0, UINT8_MAX, &mRequest.saturation); - AddArgument("TransitionTime", 0, UINT16_MAX, &mRequest.transitionTime); - AddArgument("OptionsMask", 0, UINT8_MAX, &mRequest.optionsMask); - AddArgument("OptionsOverride", 0, UINT8_MAX, &mRequest.optionsOverride); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000043) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHueAndSaturation::Type mRequest; -}; - -/* - * Command EnhancedStepHue - */ -class ColorControlEnhancedStepHue : public ModelCommand -{ -public: - ColorControlEnhancedStepHue() : ModelCommand("enhanced-step-hue") - { - AddArgument("StepMode", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.stepMode)); - AddArgument("StepSize", 0, UINT16_MAX, &mRequest.stepSize); - AddArgument("TransitionTime", 0, UINT16_MAX, &mRequest.transitionTime); - AddArgument("OptionsMask", 0, UINT8_MAX, &mRequest.optionsMask); - AddArgument("OptionsOverride", 0, UINT8_MAX, &mRequest.optionsOverride); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000042) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ColorControl::Commands::EnhancedStepHue::Type mRequest; -}; - -/* - * Command MoveColor - */ -class ColorControlMoveColor : public ModelCommand -{ -public: - ColorControlMoveColor() : ModelCommand("move-color") - { - AddArgument("RateX", INT16_MIN, INT16_MAX, &mRequest.rateX); - AddArgument("RateY", INT16_MIN, INT16_MAX, &mRequest.rateY); - AddArgument("OptionsMask", 0, UINT8_MAX, &mRequest.optionsMask); - AddArgument("OptionsOverride", 0, UINT8_MAX, &mRequest.optionsOverride); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000008) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ColorControl::Commands::MoveColor::Type mRequest; -}; - -/* - * Command MoveColorTemperature - */ -class ColorControlMoveColorTemperature : public ModelCommand -{ -public: - ColorControlMoveColorTemperature() : ModelCommand("move-color-temperature") - { - AddArgument("MoveMode", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.moveMode)); - AddArgument("Rate", 0, UINT16_MAX, &mRequest.rate); - AddArgument("ColorTemperatureMinimum", 0, UINT16_MAX, &mRequest.colorTemperatureMinimum); - AddArgument("ColorTemperatureMaximum", 0, UINT16_MAX, &mRequest.colorTemperatureMaximum); - AddArgument("OptionsMask", 0, UINT8_MAX, &mRequest.optionsMask); - AddArgument("OptionsOverride", 0, UINT8_MAX, &mRequest.optionsOverride); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x0000004B) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type mRequest; -}; - -/* - * Command MoveHue - */ -class ColorControlMoveHue : public ModelCommand -{ -public: - ColorControlMoveHue() : ModelCommand("move-hue") - { - AddArgument("MoveMode", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.moveMode)); - AddArgument("Rate", 0, UINT8_MAX, &mRequest.rate); - AddArgument("OptionsMask", 0, UINT8_MAX, &mRequest.optionsMask); - AddArgument("OptionsOverride", 0, UINT8_MAX, &mRequest.optionsOverride); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000001) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ColorControl::Commands::MoveHue::Type mRequest; -}; - -/* - * Command MoveSaturation - */ -class ColorControlMoveSaturation : public ModelCommand -{ -public: - ColorControlMoveSaturation() : ModelCommand("move-saturation") - { - AddArgument("MoveMode", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.moveMode)); - AddArgument("Rate", 0, UINT8_MAX, &mRequest.rate); - AddArgument("OptionsMask", 0, UINT8_MAX, &mRequest.optionsMask); - AddArgument("OptionsOverride", 0, UINT8_MAX, &mRequest.optionsOverride); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000004) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type mRequest; -}; - -/* - * Command MoveToColor - */ -class ColorControlMoveToColor : public ModelCommand -{ -public: - ColorControlMoveToColor() : ModelCommand("move-to-color") - { - AddArgument("ColorX", 0, UINT16_MAX, &mRequest.colorX); - AddArgument("ColorY", 0, UINT16_MAX, &mRequest.colorY); - AddArgument("TransitionTime", 0, UINT16_MAX, &mRequest.transitionTime); - AddArgument("OptionsMask", 0, UINT8_MAX, &mRequest.optionsMask); - AddArgument("OptionsOverride", 0, UINT8_MAX, &mRequest.optionsOverride); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000007) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ColorControl::Commands::MoveToColor::Type mRequest; -}; - -/* - * Command MoveToColorTemperature - */ -class ColorControlMoveToColorTemperature : public ModelCommand -{ -public: - ColorControlMoveToColorTemperature() : ModelCommand("move-to-color-temperature") - { - AddArgument("ColorTemperature", 0, UINT16_MAX, &mRequest.colorTemperature); - AddArgument("TransitionTime", 0, UINT16_MAX, &mRequest.transitionTime); - AddArgument("OptionsMask", 0, UINT8_MAX, &mRequest.optionsMask); - AddArgument("OptionsOverride", 0, UINT8_MAX, &mRequest.optionsOverride); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x0000000A) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ColorControl::Commands::MoveToColorTemperature::Type mRequest; -}; - -/* - * Command MoveToHue - */ -class ColorControlMoveToHue : public ModelCommand -{ -public: - ColorControlMoveToHue() : ModelCommand("move-to-hue") - { - AddArgument("Hue", 0, UINT8_MAX, &mRequest.hue); - AddArgument("Direction", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.direction)); - AddArgument("TransitionTime", 0, UINT16_MAX, &mRequest.transitionTime); - AddArgument("OptionsMask", 0, UINT8_MAX, &mRequest.optionsMask); - AddArgument("OptionsOverride", 0, UINT8_MAX, &mRequest.optionsOverride); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ColorControl::Commands::MoveToHue::Type mRequest; -}; - -/* - * Command MoveToHueAndSaturation - */ -class ColorControlMoveToHueAndSaturation : public ModelCommand -{ -public: - ColorControlMoveToHueAndSaturation() : ModelCommand("move-to-hue-and-saturation") - { - AddArgument("Hue", 0, UINT8_MAX, &mRequest.hue); - AddArgument("Saturation", 0, UINT8_MAX, &mRequest.saturation); - AddArgument("TransitionTime", 0, UINT16_MAX, &mRequest.transitionTime); - AddArgument("OptionsMask", 0, UINT8_MAX, &mRequest.optionsMask); - AddArgument("OptionsOverride", 0, UINT8_MAX, &mRequest.optionsOverride); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000006) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ColorControl::Commands::MoveToHueAndSaturation::Type mRequest; -}; - -/* - * Command MoveToSaturation - */ -class ColorControlMoveToSaturation : public ModelCommand -{ -public: - ColorControlMoveToSaturation() : ModelCommand("move-to-saturation") - { - AddArgument("Saturation", 0, UINT8_MAX, &mRequest.saturation); - AddArgument("TransitionTime", 0, UINT16_MAX, &mRequest.transitionTime); - AddArgument("OptionsMask", 0, UINT8_MAX, &mRequest.optionsMask); - AddArgument("OptionsOverride", 0, UINT8_MAX, &mRequest.optionsOverride); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000003) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ColorControl::Commands::MoveToSaturation::Type mRequest; -}; - -/* - * Command StepColor - */ -class ColorControlStepColor : public ModelCommand -{ -public: - ColorControlStepColor() : ModelCommand("step-color") - { - AddArgument("StepX", INT16_MIN, INT16_MAX, &mRequest.stepX); - AddArgument("StepY", INT16_MIN, INT16_MAX, &mRequest.stepY); - AddArgument("TransitionTime", 0, UINT16_MAX, &mRequest.transitionTime); - AddArgument("OptionsMask", 0, UINT8_MAX, &mRequest.optionsMask); - AddArgument("OptionsOverride", 0, UINT8_MAX, &mRequest.optionsOverride); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000009) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ColorControl::Commands::StepColor::Type mRequest; -}; - -/* - * Command StepColorTemperature - */ -class ColorControlStepColorTemperature : public ModelCommand -{ -public: - ColorControlStepColorTemperature() : ModelCommand("step-color-temperature") - { - AddArgument("StepMode", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.stepMode)); - AddArgument("StepSize", 0, UINT16_MAX, &mRequest.stepSize); - AddArgument("TransitionTime", 0, UINT16_MAX, &mRequest.transitionTime); - AddArgument("ColorTemperatureMinimum", 0, UINT16_MAX, &mRequest.colorTemperatureMinimum); - AddArgument("ColorTemperatureMaximum", 0, UINT16_MAX, &mRequest.colorTemperatureMaximum); - AddArgument("OptionsMask", 0, UINT8_MAX, &mRequest.optionsMask); - AddArgument("OptionsOverride", 0, UINT8_MAX, &mRequest.optionsOverride); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x0000004C) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ColorControl::Commands::StepColorTemperature::Type mRequest; -}; - -/* - * Command StepHue - */ -class ColorControlStepHue : public ModelCommand -{ -public: - ColorControlStepHue() : ModelCommand("step-hue") - { - AddArgument("StepMode", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.stepMode)); - AddArgument("StepSize", 0, UINT8_MAX, &mRequest.stepSize); - AddArgument("TransitionTime", 0, UINT8_MAX, &mRequest.transitionTime); - AddArgument("OptionsMask", 0, UINT8_MAX, &mRequest.optionsMask); - AddArgument("OptionsOverride", 0, UINT8_MAX, &mRequest.optionsOverride); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000002) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ColorControl::Commands::StepHue::Type mRequest; -}; - -/* - * Command StepSaturation - */ -class ColorControlStepSaturation : public ModelCommand -{ -public: - ColorControlStepSaturation() : ModelCommand("step-saturation") - { - AddArgument("StepMode", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.stepMode)); - AddArgument("StepSize", 0, UINT8_MAX, &mRequest.stepSize); - AddArgument("TransitionTime", 0, UINT8_MAX, &mRequest.transitionTime); - AddArgument("OptionsMask", 0, UINT8_MAX, &mRequest.optionsMask); - AddArgument("OptionsOverride", 0, UINT8_MAX, &mRequest.optionsOverride); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000005) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ColorControl::Commands::StepSaturation::Type mRequest; -}; - -/* - * Command StopMoveStep - */ -class ColorControlStopMoveStep : public ModelCommand -{ -public: - ColorControlStopMoveStep() : ModelCommand("stop-move-step") - { - AddArgument("OptionsMask", 0, UINT8_MAX, &mRequest.optionsMask); - AddArgument("OptionsOverride", 0, UINT8_MAX, &mRequest.optionsOverride); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) command (0x00000047) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type mRequest; -}; - -/* - * Attribute CurrentHue - */ -class ReadColorControlCurrentHue : public ModelCommand -{ -public: - ReadColorControlCurrentHue() : ModelCommand("read") - { - AddArgument("attr-name", "current-hue"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlCurrentHue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.CurrentHue response", value); - } -}; - -class ReportColorControlCurrentHue : public ModelCommand -{ -public: - ReportColorControlCurrentHue() : ModelCommand("subscribe") - { - AddArgument("attr-name", "current-hue"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlCurrentHue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("ColorControl.CurrentHue report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute CurrentSaturation - */ -class ReadColorControlCurrentSaturation : public ModelCommand -{ -public: - ReadColorControlCurrentSaturation() : ModelCommand("read") - { - AddArgument("attr-name", "current-saturation"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlCurrentSaturation() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.CurrentSaturation response", value); - } -}; - -class ReportColorControlCurrentSaturation : public ModelCommand -{ -public: - ReportColorControlCurrentSaturation() : ModelCommand("subscribe") - { - AddArgument("attr-name", "current-saturation"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlCurrentSaturation() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("ColorControl.CurrentSaturation report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute RemainingTime - */ -class ReadColorControlRemainingTime : public ModelCommand -{ -public: - ReadColorControlRemainingTime() : ModelCommand("read") - { - AddArgument("attr-name", "remaining-time"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlRemainingTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.RemainingTime response", value); - } -}; - -class ReportColorControlRemainingTime : public ModelCommand -{ -public: - ReportColorControlRemainingTime() : ModelCommand("subscribe") - { - AddArgument("attr-name", "remaining-time"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlRemainingTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.RemainingTime report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute CurrentX - */ -class ReadColorControlCurrentX : public ModelCommand -{ -public: - ReadColorControlCurrentX() : ModelCommand("read") - { - AddArgument("attr-name", "current-x"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlCurrentX() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.CurrentX response", value); - } -}; - -class ReportColorControlCurrentX : public ModelCommand -{ -public: - ReportColorControlCurrentX() : ModelCommand("subscribe") - { - AddArgument("attr-name", "current-x"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlCurrentX() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.CurrentX report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute CurrentY - */ -class ReadColorControlCurrentY : public ModelCommand -{ -public: - ReadColorControlCurrentY() : ModelCommand("read") - { - AddArgument("attr-name", "current-y"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlCurrentY() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.CurrentY response", value); - } -}; - -class ReportColorControlCurrentY : public ModelCommand -{ -public: - ReportColorControlCurrentY() : ModelCommand("subscribe") - { - AddArgument("attr-name", "current-y"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlCurrentY() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.CurrentY report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute DriftCompensation - */ -class ReadColorControlDriftCompensation : public ModelCommand -{ -public: - ReadColorControlDriftCompensation() : ModelCommand("read") - { - AddArgument("attr-name", "drift-compensation"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlDriftCompensation() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.DriftCompensation response", value); - } -}; - -class ReportColorControlDriftCompensation : public ModelCommand -{ -public: - ReportColorControlDriftCompensation() : ModelCommand("subscribe") - { - AddArgument("attr-name", "drift-compensation"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlDriftCompensation() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("ColorControl.DriftCompensation report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute CompensationText - */ -class ReadColorControlCompensationText : public ModelCommand -{ -public: - ReadColorControlCompensationText() : ModelCommand("read") - { - AddArgument("attr-name", "compensation-text"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlCompensationText() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::CharSpan value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.CompensationText response", value); - } -}; - -class ReportColorControlCompensationText : public ModelCommand -{ -public: - ReportColorControlCompensationText() : ModelCommand("subscribe") - { - AddArgument("attr-name", "compensation-text"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlCompensationText() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::CharSpan value) - { - DataModelLogger::LogValue("ColorControl.CompensationText report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ColorTemperature - */ -class ReadColorControlColorTemperature : public ModelCommand -{ -public: - ReadColorControlColorTemperature() : ModelCommand("read") - { - AddArgument("attr-name", "color-temperature"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlColorTemperature() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000007) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.ColorTemperature response", value); - } -}; - -class ReportColorControlColorTemperature : public ModelCommand -{ -public: - ReportColorControlColorTemperature() : ModelCommand("subscribe") - { - AddArgument("attr-name", "color-temperature"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlColorTemperature() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000007) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.ColorTemperature report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ColorMode - */ -class ReadColorControlColorMode : public ModelCommand -{ -public: - ReadColorControlColorMode() : ModelCommand("read") - { - AddArgument("attr-name", "color-mode"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlColorMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000008) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.ColorMode response", value); - } -}; - -class ReportColorControlColorMode : public ModelCommand -{ -public: - ReportColorControlColorMode() : ModelCommand("subscribe") - { - AddArgument("attr-name", "color-mode"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlColorMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000008) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("ColorControl.ColorMode report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ColorControlOptions - */ -class ReadColorControlColorControlOptions : public ModelCommand -{ -public: - ReadColorControlColorControlOptions() : ModelCommand("read") - { - AddArgument("attr-name", "color-control-options"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlColorControlOptions() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x0000000F) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.ColorControlOptions response", value); - } -}; - -class WriteColorControlColorControlOptions : public ModelCommand -{ -public: - WriteColorControlColorControlOptions() : ModelCommand("write") - { - AddArgument("attr-name", "color-control-options"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteColorControlColorControlOptions() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x0000000F) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint8_t mValue; -}; - -class ReportColorControlColorControlOptions : public ModelCommand -{ -public: - ReportColorControlColorControlOptions() : ModelCommand("subscribe") - { - AddArgument("attr-name", "color-control-options"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlColorControlOptions() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x0000000F) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("ColorControl.ColorControlOptions report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NumberOfPrimaries - */ -class ReadColorControlNumberOfPrimaries : public ModelCommand -{ -public: - ReadColorControlNumberOfPrimaries() : ModelCommand("read") - { - AddArgument("attr-name", "number-of-primaries"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlNumberOfPrimaries() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000010) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.NumberOfPrimaries response", value); - } -}; - -class ReportColorControlNumberOfPrimaries : public ModelCommand -{ -public: - ReportColorControlNumberOfPrimaries() : ModelCommand("subscribe") - { - AddArgument("attr-name", "number-of-primaries"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlNumberOfPrimaries() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000010) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("ColorControl.NumberOfPrimaries report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Primary1X - */ -class ReadColorControlPrimary1X : public ModelCommand -{ -public: - ReadColorControlPrimary1X() : ModelCommand("read") - { - AddArgument("attr-name", "primary1x"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlPrimary1X() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000011) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.Primary1X response", value); - } -}; - -class ReportColorControlPrimary1X : public ModelCommand -{ -public: - ReportColorControlPrimary1X() : ModelCommand("subscribe") - { - AddArgument("attr-name", "primary1x"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlPrimary1X() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000011) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.Primary1X report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Primary1Y - */ -class ReadColorControlPrimary1Y : public ModelCommand -{ -public: - ReadColorControlPrimary1Y() : ModelCommand("read") - { - AddArgument("attr-name", "primary1y"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlPrimary1Y() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000012) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.Primary1Y response", value); - } -}; - -class ReportColorControlPrimary1Y : public ModelCommand -{ -public: - ReportColorControlPrimary1Y() : ModelCommand("subscribe") - { - AddArgument("attr-name", "primary1y"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlPrimary1Y() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000012) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.Primary1Y report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Primary1Intensity - */ -class ReadColorControlPrimary1Intensity : public ModelCommand -{ -public: - ReadColorControlPrimary1Intensity() : ModelCommand("read") - { - AddArgument("attr-name", "primary1intensity"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlPrimary1Intensity() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000013) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.Primary1Intensity response", value); - } -}; - -class ReportColorControlPrimary1Intensity : public ModelCommand -{ -public: - ReportColorControlPrimary1Intensity() : ModelCommand("subscribe") - { - AddArgument("attr-name", "primary1intensity"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlPrimary1Intensity() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000013) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("ColorControl.Primary1Intensity report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Primary2X - */ -class ReadColorControlPrimary2X : public ModelCommand -{ -public: - ReadColorControlPrimary2X() : ModelCommand("read") - { - AddArgument("attr-name", "primary2x"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlPrimary2X() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000015) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.Primary2X response", value); - } -}; - -class ReportColorControlPrimary2X : public ModelCommand -{ -public: - ReportColorControlPrimary2X() : ModelCommand("subscribe") - { - AddArgument("attr-name", "primary2x"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlPrimary2X() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000015) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.Primary2X report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Primary2Y - */ -class ReadColorControlPrimary2Y : public ModelCommand -{ -public: - ReadColorControlPrimary2Y() : ModelCommand("read") - { - AddArgument("attr-name", "primary2y"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlPrimary2Y() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000016) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.Primary2Y response", value); - } -}; - -class ReportColorControlPrimary2Y : public ModelCommand -{ -public: - ReportColorControlPrimary2Y() : ModelCommand("subscribe") - { - AddArgument("attr-name", "primary2y"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlPrimary2Y() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000016) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.Primary2Y report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Primary2Intensity - */ -class ReadColorControlPrimary2Intensity : public ModelCommand -{ -public: - ReadColorControlPrimary2Intensity() : ModelCommand("read") - { - AddArgument("attr-name", "primary2intensity"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlPrimary2Intensity() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000017) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.Primary2Intensity response", value); - } -}; - -class ReportColorControlPrimary2Intensity : public ModelCommand -{ -public: - ReportColorControlPrimary2Intensity() : ModelCommand("subscribe") - { - AddArgument("attr-name", "primary2intensity"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlPrimary2Intensity() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000017) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("ColorControl.Primary2Intensity report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Primary3X - */ -class ReadColorControlPrimary3X : public ModelCommand -{ -public: - ReadColorControlPrimary3X() : ModelCommand("read") - { - AddArgument("attr-name", "primary3x"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlPrimary3X() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000019) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.Primary3X response", value); - } -}; - -class ReportColorControlPrimary3X : public ModelCommand -{ -public: - ReportColorControlPrimary3X() : ModelCommand("subscribe") - { - AddArgument("attr-name", "primary3x"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlPrimary3X() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000019) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.Primary3X report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Primary3Y - */ -class ReadColorControlPrimary3Y : public ModelCommand -{ -public: - ReadColorControlPrimary3Y() : ModelCommand("read") - { - AddArgument("attr-name", "primary3y"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlPrimary3Y() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x0000001A) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.Primary3Y response", value); - } -}; - -class ReportColorControlPrimary3Y : public ModelCommand -{ -public: - ReportColorControlPrimary3Y() : ModelCommand("subscribe") - { - AddArgument("attr-name", "primary3y"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlPrimary3Y() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x0000001A) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.Primary3Y report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Primary3Intensity - */ -class ReadColorControlPrimary3Intensity : public ModelCommand -{ -public: - ReadColorControlPrimary3Intensity() : ModelCommand("read") - { - AddArgument("attr-name", "primary3intensity"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlPrimary3Intensity() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x0000001B) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.Primary3Intensity response", value); - } -}; - -class ReportColorControlPrimary3Intensity : public ModelCommand -{ -public: - ReportColorControlPrimary3Intensity() : ModelCommand("subscribe") - { - AddArgument("attr-name", "primary3intensity"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlPrimary3Intensity() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x0000001B) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("ColorControl.Primary3Intensity report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Primary4X - */ -class ReadColorControlPrimary4X : public ModelCommand -{ -public: - ReadColorControlPrimary4X() : ModelCommand("read") - { - AddArgument("attr-name", "primary4x"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlPrimary4X() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000020) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.Primary4X response", value); - } -}; - -class ReportColorControlPrimary4X : public ModelCommand -{ -public: - ReportColorControlPrimary4X() : ModelCommand("subscribe") - { - AddArgument("attr-name", "primary4x"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlPrimary4X() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000020) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.Primary4X report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Primary4Y - */ -class ReadColorControlPrimary4Y : public ModelCommand -{ -public: - ReadColorControlPrimary4Y() : ModelCommand("read") - { - AddArgument("attr-name", "primary4y"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlPrimary4Y() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000021) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.Primary4Y response", value); - } -}; - -class ReportColorControlPrimary4Y : public ModelCommand -{ -public: - ReportColorControlPrimary4Y() : ModelCommand("subscribe") - { - AddArgument("attr-name", "primary4y"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlPrimary4Y() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000021) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.Primary4Y report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Primary4Intensity - */ -class ReadColorControlPrimary4Intensity : public ModelCommand -{ -public: - ReadColorControlPrimary4Intensity() : ModelCommand("read") - { - AddArgument("attr-name", "primary4intensity"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlPrimary4Intensity() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000022) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.Primary4Intensity response", value); - } -}; - -class ReportColorControlPrimary4Intensity : public ModelCommand -{ -public: - ReportColorControlPrimary4Intensity() : ModelCommand("subscribe") - { - AddArgument("attr-name", "primary4intensity"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlPrimary4Intensity() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000022) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("ColorControl.Primary4Intensity report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Primary5X - */ -class ReadColorControlPrimary5X : public ModelCommand -{ -public: - ReadColorControlPrimary5X() : ModelCommand("read") - { - AddArgument("attr-name", "primary5x"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlPrimary5X() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000024) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.Primary5X response", value); - } -}; - -class ReportColorControlPrimary5X : public ModelCommand -{ -public: - ReportColorControlPrimary5X() : ModelCommand("subscribe") - { - AddArgument("attr-name", "primary5x"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlPrimary5X() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000024) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.Primary5X report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Primary5Y - */ -class ReadColorControlPrimary5Y : public ModelCommand -{ -public: - ReadColorControlPrimary5Y() : ModelCommand("read") - { - AddArgument("attr-name", "primary5y"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlPrimary5Y() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000025) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.Primary5Y response", value); - } -}; - -class ReportColorControlPrimary5Y : public ModelCommand -{ -public: - ReportColorControlPrimary5Y() : ModelCommand("subscribe") - { - AddArgument("attr-name", "primary5y"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlPrimary5Y() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000025) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.Primary5Y report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Primary5Intensity - */ -class ReadColorControlPrimary5Intensity : public ModelCommand -{ -public: - ReadColorControlPrimary5Intensity() : ModelCommand("read") - { - AddArgument("attr-name", "primary5intensity"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlPrimary5Intensity() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000026) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.Primary5Intensity response", value); - } -}; - -class ReportColorControlPrimary5Intensity : public ModelCommand -{ -public: - ReportColorControlPrimary5Intensity() : ModelCommand("subscribe") - { - AddArgument("attr-name", "primary5intensity"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlPrimary5Intensity() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000026) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("ColorControl.Primary5Intensity report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Primary6X - */ -class ReadColorControlPrimary6X : public ModelCommand -{ -public: - ReadColorControlPrimary6X() : ModelCommand("read") - { - AddArgument("attr-name", "primary6x"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlPrimary6X() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000028) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.Primary6X response", value); - } -}; - -class ReportColorControlPrimary6X : public ModelCommand -{ -public: - ReportColorControlPrimary6X() : ModelCommand("subscribe") - { - AddArgument("attr-name", "primary6x"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlPrimary6X() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000028) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.Primary6X report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Primary6Y - */ -class ReadColorControlPrimary6Y : public ModelCommand -{ -public: - ReadColorControlPrimary6Y() : ModelCommand("read") - { - AddArgument("attr-name", "primary6y"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlPrimary6Y() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000029) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.Primary6Y response", value); - } -}; - -class ReportColorControlPrimary6Y : public ModelCommand -{ -public: - ReportColorControlPrimary6Y() : ModelCommand("subscribe") - { - AddArgument("attr-name", "primary6y"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlPrimary6Y() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000029) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.Primary6Y report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Primary6Intensity - */ -class ReadColorControlPrimary6Intensity : public ModelCommand -{ -public: - ReadColorControlPrimary6Intensity() : ModelCommand("read") - { - AddArgument("attr-name", "primary6intensity"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlPrimary6Intensity() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x0000002A) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.Primary6Intensity response", value); - } -}; - -class ReportColorControlPrimary6Intensity : public ModelCommand -{ -public: - ReportColorControlPrimary6Intensity() : ModelCommand("subscribe") - { - AddArgument("attr-name", "primary6intensity"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlPrimary6Intensity() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x0000002A) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("ColorControl.Primary6Intensity report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute WhitePointX - */ -class ReadColorControlWhitePointX : public ModelCommand -{ -public: - ReadColorControlWhitePointX() : ModelCommand("read") - { - AddArgument("attr-name", "white-point-x"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlWhitePointX() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000030) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.WhitePointX response", value); - } -}; - -class WriteColorControlWhitePointX : public ModelCommand -{ -public: - WriteColorControlWhitePointX() : ModelCommand("write") - { - AddArgument("attr-name", "white-point-x"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteColorControlWhitePointX() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x00000030) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint16_t mValue; -}; - -class ReportColorControlWhitePointX : public ModelCommand -{ -public: - ReportColorControlWhitePointX() : ModelCommand("subscribe") - { - AddArgument("attr-name", "white-point-x"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlWhitePointX() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000030) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.WhitePointX report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute WhitePointY - */ -class ReadColorControlWhitePointY : public ModelCommand -{ -public: - ReadColorControlWhitePointY() : ModelCommand("read") - { - AddArgument("attr-name", "white-point-y"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlWhitePointY() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000031) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.WhitePointY response", value); - } -}; - -class WriteColorControlWhitePointY : public ModelCommand -{ -public: - WriteColorControlWhitePointY() : ModelCommand("write") - { - AddArgument("attr-name", "white-point-y"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteColorControlWhitePointY() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x00000031) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint16_t mValue; -}; - -class ReportColorControlWhitePointY : public ModelCommand -{ -public: - ReportColorControlWhitePointY() : ModelCommand("subscribe") - { - AddArgument("attr-name", "white-point-y"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlWhitePointY() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000031) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.WhitePointY report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ColorPointRX - */ -class ReadColorControlColorPointRX : public ModelCommand -{ -public: - ReadColorControlColorPointRX() : ModelCommand("read") - { - AddArgument("attr-name", "color-point-rx"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlColorPointRX() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000032) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.ColorPointRX response", value); - } -}; - -class WriteColorControlColorPointRX : public ModelCommand -{ -public: - WriteColorControlColorPointRX() : ModelCommand("write") - { - AddArgument("attr-name", "color-point-rx"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteColorControlColorPointRX() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x00000032) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint16_t mValue; -}; - -class ReportColorControlColorPointRX : public ModelCommand -{ -public: - ReportColorControlColorPointRX() : ModelCommand("subscribe") - { - AddArgument("attr-name", "color-point-rx"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlColorPointRX() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000032) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.ColorPointRX report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ColorPointRY - */ -class ReadColorControlColorPointRY : public ModelCommand -{ -public: - ReadColorControlColorPointRY() : ModelCommand("read") - { - AddArgument("attr-name", "color-point-ry"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlColorPointRY() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000033) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.ColorPointRY response", value); - } -}; - -class WriteColorControlColorPointRY : public ModelCommand -{ -public: - WriteColorControlColorPointRY() : ModelCommand("write") - { - AddArgument("attr-name", "color-point-ry"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteColorControlColorPointRY() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x00000033) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint16_t mValue; -}; - -class ReportColorControlColorPointRY : public ModelCommand -{ -public: - ReportColorControlColorPointRY() : ModelCommand("subscribe") - { - AddArgument("attr-name", "color-point-ry"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlColorPointRY() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000033) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.ColorPointRY report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ColorPointRIntensity - */ -class ReadColorControlColorPointRIntensity : public ModelCommand -{ -public: - ReadColorControlColorPointRIntensity() : ModelCommand("read") - { - AddArgument("attr-name", "color-point-rintensity"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlColorPointRIntensity() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000034) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.ColorPointRIntensity response", value); - } -}; - -class WriteColorControlColorPointRIntensity : public ModelCommand -{ -public: - WriteColorControlColorPointRIntensity() : ModelCommand("write") - { - AddArgument("attr-name", "color-point-rintensity"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteColorControlColorPointRIntensity() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x00000034) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint8_t mValue; -}; - -class ReportColorControlColorPointRIntensity : public ModelCommand -{ -public: - ReportColorControlColorPointRIntensity() : ModelCommand("subscribe") - { - AddArgument("attr-name", "color-point-rintensity"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlColorPointRIntensity() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000034) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("ColorControl.ColorPointRIntensity report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ColorPointGX - */ -class ReadColorControlColorPointGX : public ModelCommand -{ -public: - ReadColorControlColorPointGX() : ModelCommand("read") - { - AddArgument("attr-name", "color-point-gx"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlColorPointGX() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000036) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.ColorPointGX response", value); - } -}; - -class WriteColorControlColorPointGX : public ModelCommand -{ -public: - WriteColorControlColorPointGX() : ModelCommand("write") - { - AddArgument("attr-name", "color-point-gx"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteColorControlColorPointGX() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x00000036) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint16_t mValue; -}; - -class ReportColorControlColorPointGX : public ModelCommand -{ -public: - ReportColorControlColorPointGX() : ModelCommand("subscribe") - { - AddArgument("attr-name", "color-point-gx"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlColorPointGX() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000036) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.ColorPointGX report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ColorPointGY - */ -class ReadColorControlColorPointGY : public ModelCommand -{ -public: - ReadColorControlColorPointGY() : ModelCommand("read") - { - AddArgument("attr-name", "color-point-gy"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlColorPointGY() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000037) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.ColorPointGY response", value); - } -}; - -class WriteColorControlColorPointGY : public ModelCommand -{ -public: - WriteColorControlColorPointGY() : ModelCommand("write") - { - AddArgument("attr-name", "color-point-gy"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteColorControlColorPointGY() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x00000037) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint16_t mValue; -}; - -class ReportColorControlColorPointGY : public ModelCommand -{ -public: - ReportColorControlColorPointGY() : ModelCommand("subscribe") - { - AddArgument("attr-name", "color-point-gy"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlColorPointGY() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000037) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.ColorPointGY report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ColorPointGIntensity - */ -class ReadColorControlColorPointGIntensity : public ModelCommand -{ -public: - ReadColorControlColorPointGIntensity() : ModelCommand("read") - { - AddArgument("attr-name", "color-point-gintensity"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlColorPointGIntensity() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00000038) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.ColorPointGIntensity response", value); - } -}; - -class WriteColorControlColorPointGIntensity : public ModelCommand -{ -public: - WriteColorControlColorPointGIntensity() : ModelCommand("write") - { - AddArgument("attr-name", "color-point-gintensity"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteColorControlColorPointGIntensity() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x00000038) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint8_t mValue; -}; - -class ReportColorControlColorPointGIntensity : public ModelCommand -{ -public: - ReportColorControlColorPointGIntensity() : ModelCommand("subscribe") - { - AddArgument("attr-name", "color-point-gintensity"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlColorPointGIntensity() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00000038) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("ColorControl.ColorPointGIntensity report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ColorPointBX - */ -class ReadColorControlColorPointBX : public ModelCommand -{ -public: - ReadColorControlColorPointBX() : ModelCommand("read") - { - AddArgument("attr-name", "color-point-bx"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlColorPointBX() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x0000003A) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.ColorPointBX response", value); - } -}; - -class WriteColorControlColorPointBX : public ModelCommand -{ -public: - WriteColorControlColorPointBX() : ModelCommand("write") - { - AddArgument("attr-name", "color-point-bx"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteColorControlColorPointBX() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x0000003A) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint16_t mValue; -}; - -class ReportColorControlColorPointBX : public ModelCommand -{ -public: - ReportColorControlColorPointBX() : ModelCommand("subscribe") - { - AddArgument("attr-name", "color-point-bx"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlColorPointBX() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x0000003A) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.ColorPointBX report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ColorPointBY - */ -class ReadColorControlColorPointBY : public ModelCommand -{ -public: - ReadColorControlColorPointBY() : ModelCommand("read") - { - AddArgument("attr-name", "color-point-by"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlColorPointBY() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x0000003B) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.ColorPointBY response", value); - } -}; - -class WriteColorControlColorPointBY : public ModelCommand -{ -public: - WriteColorControlColorPointBY() : ModelCommand("write") - { - AddArgument("attr-name", "color-point-by"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteColorControlColorPointBY() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x0000003B) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint16_t mValue; -}; - -class ReportColorControlColorPointBY : public ModelCommand -{ -public: - ReportColorControlColorPointBY() : ModelCommand("subscribe") - { - AddArgument("attr-name", "color-point-by"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlColorPointBY() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x0000003B) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.ColorPointBY report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ColorPointBIntensity - */ -class ReadColorControlColorPointBIntensity : public ModelCommand -{ -public: - ReadColorControlColorPointBIntensity() : ModelCommand("read") - { - AddArgument("attr-name", "color-point-bintensity"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlColorPointBIntensity() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x0000003C) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.ColorPointBIntensity response", value); - } -}; - -class WriteColorControlColorPointBIntensity : public ModelCommand -{ -public: - WriteColorControlColorPointBIntensity() : ModelCommand("write") - { - AddArgument("attr-name", "color-point-bintensity"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteColorControlColorPointBIntensity() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x0000003C) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint8_t mValue; -}; - -class ReportColorControlColorPointBIntensity : public ModelCommand -{ -public: - ReportColorControlColorPointBIntensity() : ModelCommand("subscribe") - { - AddArgument("attr-name", "color-point-bintensity"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlColorPointBIntensity() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x0000003C) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("ColorControl.ColorPointBIntensity report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute EnhancedCurrentHue - */ -class ReadColorControlEnhancedCurrentHue : public ModelCommand -{ -public: - ReadColorControlEnhancedCurrentHue() : ModelCommand("read") - { - AddArgument("attr-name", "enhanced-current-hue"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlEnhancedCurrentHue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00004000) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.EnhancedCurrentHue response", value); - } -}; - -class ReportColorControlEnhancedCurrentHue : public ModelCommand -{ -public: - ReportColorControlEnhancedCurrentHue() : ModelCommand("subscribe") - { - AddArgument("attr-name", "enhanced-current-hue"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlEnhancedCurrentHue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00004000) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.EnhancedCurrentHue report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute EnhancedColorMode - */ -class ReadColorControlEnhancedColorMode : public ModelCommand -{ -public: - ReadColorControlEnhancedColorMode() : ModelCommand("read") - { - AddArgument("attr-name", "enhanced-color-mode"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlEnhancedColorMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00004001) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.EnhancedColorMode response", value); - } -}; - -class ReportColorControlEnhancedColorMode : public ModelCommand -{ -public: - ReportColorControlEnhancedColorMode() : ModelCommand("subscribe") - { - AddArgument("attr-name", "enhanced-color-mode"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlEnhancedColorMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00004001) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("ColorControl.EnhancedColorMode report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ColorLoopActive - */ -class ReadColorControlColorLoopActive : public ModelCommand -{ -public: - ReadColorControlColorLoopActive() : ModelCommand("read") - { - AddArgument("attr-name", "color-loop-active"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlColorLoopActive() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00004002) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.ColorLoopActive response", value); - } -}; - -class ReportColorControlColorLoopActive : public ModelCommand -{ -public: - ReportColorControlColorLoopActive() : ModelCommand("subscribe") - { - AddArgument("attr-name", "color-loop-active"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlColorLoopActive() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00004002) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("ColorControl.ColorLoopActive report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ColorLoopDirection - */ -class ReadColorControlColorLoopDirection : public ModelCommand -{ -public: - ReadColorControlColorLoopDirection() : ModelCommand("read") - { - AddArgument("attr-name", "color-loop-direction"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlColorLoopDirection() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00004003) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.ColorLoopDirection response", value); - } -}; - -class ReportColorControlColorLoopDirection : public ModelCommand -{ -public: - ReportColorControlColorLoopDirection() : ModelCommand("subscribe") - { - AddArgument("attr-name", "color-loop-direction"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlColorLoopDirection() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00004003) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("ColorControl.ColorLoopDirection report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ColorLoopTime - */ -class ReadColorControlColorLoopTime : public ModelCommand -{ -public: - ReadColorControlColorLoopTime() : ModelCommand("read") - { - AddArgument("attr-name", "color-loop-time"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlColorLoopTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00004004) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.ColorLoopTime response", value); - } -}; - -class ReportColorControlColorLoopTime : public ModelCommand -{ -public: - ReportColorControlColorLoopTime() : ModelCommand("subscribe") - { - AddArgument("attr-name", "color-loop-time"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlColorLoopTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00004004) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.ColorLoopTime report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ColorLoopStartEnhancedHue - */ -class ReadColorControlColorLoopStartEnhancedHue : public ModelCommand -{ -public: - ReadColorControlColorLoopStartEnhancedHue() : ModelCommand("read") - { - AddArgument("attr-name", "color-loop-start-enhanced-hue"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlColorLoopStartEnhancedHue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00004005) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.ColorLoopStartEnhancedHue response", value); - } -}; - -class ReportColorControlColorLoopStartEnhancedHue : public ModelCommand -{ -public: - ReportColorControlColorLoopStartEnhancedHue() : ModelCommand("subscribe") - { - AddArgument("attr-name", "color-loop-start-enhanced-hue"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlColorLoopStartEnhancedHue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00004005) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.ColorLoopStartEnhancedHue report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ColorLoopStoredEnhancedHue - */ -class ReadColorControlColorLoopStoredEnhancedHue : public ModelCommand -{ -public: - ReadColorControlColorLoopStoredEnhancedHue() : ModelCommand("read") - { - AddArgument("attr-name", "color-loop-stored-enhanced-hue"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlColorLoopStoredEnhancedHue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00004006) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.ColorLoopStoredEnhancedHue response", value); - } -}; - -class ReportColorControlColorLoopStoredEnhancedHue : public ModelCommand -{ -public: - ReportColorControlColorLoopStoredEnhancedHue() : ModelCommand("subscribe") - { - AddArgument("attr-name", "color-loop-stored-enhanced-hue"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlColorLoopStoredEnhancedHue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00004006) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.ColorLoopStoredEnhancedHue report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ColorCapabilities - */ -class ReadColorControlColorCapabilities : public ModelCommand -{ -public: - ReadColorControlColorCapabilities() : ModelCommand("read") - { - AddArgument("attr-name", "color-capabilities"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlColorCapabilities() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x0000400A) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.ColorCapabilities response", value); - } -}; - -class ReportColorControlColorCapabilities : public ModelCommand -{ -public: - ReportColorControlColorCapabilities() : ModelCommand("subscribe") - { - AddArgument("attr-name", "color-capabilities"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlColorCapabilities() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x0000400A) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.ColorCapabilities report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ColorTempPhysicalMin - */ -class ReadColorControlColorTempPhysicalMin : public ModelCommand -{ -public: - ReadColorControlColorTempPhysicalMin() : ModelCommand("read") - { - AddArgument("attr-name", "color-temp-physical-min"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlColorTempPhysicalMin() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x0000400B) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.ColorTempPhysicalMin response", value); - } -}; - -class ReportColorControlColorTempPhysicalMin : public ModelCommand -{ -public: - ReportColorControlColorTempPhysicalMin() : ModelCommand("subscribe") - { - AddArgument("attr-name", "color-temp-physical-min"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlColorTempPhysicalMin() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x0000400B) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.ColorTempPhysicalMin report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ColorTempPhysicalMax - */ -class ReadColorControlColorTempPhysicalMax : public ModelCommand -{ -public: - ReadColorControlColorTempPhysicalMax() : ModelCommand("read") - { - AddArgument("attr-name", "color-temp-physical-max"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlColorTempPhysicalMax() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x0000400C) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.ColorTempPhysicalMax response", value); - } -}; - -class ReportColorControlColorTempPhysicalMax : public ModelCommand -{ -public: - ReportColorControlColorTempPhysicalMax() : ModelCommand("subscribe") - { - AddArgument("attr-name", "color-temp-physical-max"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlColorTempPhysicalMax() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x0000400C) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.ColorTempPhysicalMax report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute CoupleColorTempToLevelMinMireds - */ -class ReadColorControlCoupleColorTempToLevelMinMireds : public ModelCommand -{ -public: - ReadColorControlCoupleColorTempToLevelMinMireds() : ModelCommand("read") - { - AddArgument("attr-name", "couple-color-temp-to-level-min-mireds"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlCoupleColorTempToLevelMinMireds() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x0000400D) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.CoupleColorTempToLevelMinMireds response", value); - } -}; - -class ReportColorControlCoupleColorTempToLevelMinMireds : public ModelCommand -{ -public: - ReportColorControlCoupleColorTempToLevelMinMireds() : ModelCommand("subscribe") - { - AddArgument("attr-name", "couple-color-temp-to-level-min-mireds"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlCoupleColorTempToLevelMinMireds() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x0000400D) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.CoupleColorTempToLevelMinMireds report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute StartUpColorTemperatureMireds - */ -class ReadColorControlStartUpColorTemperatureMireds : public ModelCommand -{ -public: - ReadColorControlStartUpColorTemperatureMireds() : ModelCommand("read") - { - AddArgument("attr-name", "start-up-color-temperature-mireds"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlStartUpColorTemperatureMireds() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x00004010) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.StartUpColorTemperatureMireds response", value); - } -}; - -class WriteColorControlStartUpColorTemperatureMireds : public ModelCommand -{ -public: - WriteColorControlStartUpColorTemperatureMireds() : ModelCommand("write") - { - AddArgument("attr-name", "start-up-color-temperature-mireds"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteColorControlStartUpColorTemperatureMireds() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) WriteAttribute (0x00004010) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint16_t mValue; -}; - -class ReportColorControlStartUpColorTemperatureMireds : public ModelCommand -{ -public: - ReportColorControlStartUpColorTemperatureMireds() : ModelCommand("subscribe") - { - AddArgument("attr-name", "start-up-color-temperature-mireds"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlStartUpColorTemperatureMireds() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x00004010) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.StartUpColorTemperatureMireds report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadColorControlAttributeList : public ModelCommand -{ -public: - ReadColorControlAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.AttributeList response", value); - } -}; - -class ReportColorControlAttributeList : public ModelCommand -{ -public: - ReportColorControlAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("ColorControl.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadColorControlClusterRevision : public ModelCommand -{ -public: - ReadColorControlClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadColorControlClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ColorControl.ClusterRevision response", value); - } -}; - -class ReportColorControlClusterRevision : public ModelCommand -{ -public: - ReportColorControlClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportColorControlClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000300) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::ColorControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ColorControl.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster ContentLauncher | 0x050A | -|------------------------------------------------------------------------------| -| Commands: | | -| * LaunchContentRequest | 0x00 | -| * LaunchURLRequest | 0x01 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * AcceptHeaderList | 0x0000 | -| * SupportedStreamingProtocols | 0x0001 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command LaunchContentRequest - */ -class ContentLauncherLaunchContentRequest : public ModelCommand -{ -public: - ContentLauncherLaunchContentRequest() : ModelCommand("launch-content-request"), mComplex_Search(&mRequest.search) - { - AddArgument("AutoPlay", 0, 1, &mRequest.autoPlay); - AddArgument("Data", &mRequest.data); - AddArgument("Search", &mComplex_Search); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050A) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnContentLauncherLaunchResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ContentLauncher::Commands::LaunchContentRequest::Type mRequest; - TypedComplexArgument> - mComplex_Search; -}; - -/* - * Command LaunchURLRequest - */ -class ContentLauncherLaunchURLRequest : public ModelCommand -{ -public: - ContentLauncherLaunchURLRequest() : - ModelCommand("launch-urlrequest"), mComplex_BrandingInformation(&mRequest.brandingInformation) - { - AddArgument("ContentURL", &mRequest.contentURL); - AddArgument("DisplayString", &mRequest.displayString); - AddArgument("BrandingInformation", &mComplex_BrandingInformation); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050A) command (0x00000001) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnContentLauncherLaunchResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ContentLauncher::Commands::LaunchURLRequest::Type mRequest; - TypedComplexArgument mComplex_BrandingInformation; -}; - -/* - * Attribute AcceptHeaderList - */ -class ReadContentLauncherAcceptHeaderList : public ModelCommand -{ -public: - ReadContentLauncherAcceptHeaderList() : ModelCommand("read") - { - AddArgument("attr-name", "accept-header-list"); - ModelCommand::AddArguments(); - } - - ~ReadContentLauncherAcceptHeaderList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050A) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::ContentLauncherCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "ContentLauncher.AcceptHeaderList response", value); - } -}; - -class ReportContentLauncherAcceptHeaderList : public ModelCommand -{ -public: - ReportContentLauncherAcceptHeaderList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "accept-header-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportContentLauncherAcceptHeaderList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050A) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::ContentLauncherCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("ContentLauncher.AcceptHeaderList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute SupportedStreamingProtocols - */ -class ReadContentLauncherSupportedStreamingProtocols : public ModelCommand -{ -public: - ReadContentLauncherSupportedStreamingProtocols() : ModelCommand("read") - { - AddArgument("attr-name", "supported-streaming-protocols"); - ModelCommand::AddArguments(); - } - - ~ReadContentLauncherSupportedStreamingProtocols() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050A) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::ContentLauncherCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint32_t value) - { - OnGeneralAttributeEventResponse(context, "ContentLauncher.SupportedStreamingProtocols response", value); - } -}; - -class WriteContentLauncherSupportedStreamingProtocols : public ModelCommand -{ -public: - WriteContentLauncherSupportedStreamingProtocols() : ModelCommand("write") - { - AddArgument("attr-name", "supported-streaming-protocols"); - AddArgument("attr-value", 0, UINT32_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteContentLauncherSupportedStreamingProtocols() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050A) WriteAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::ContentLauncherCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint32_t mValue; -}; - -class ReportContentLauncherSupportedStreamingProtocols : public ModelCommand -{ -public: - ReportContentLauncherSupportedStreamingProtocols() : ModelCommand("subscribe") - { - AddArgument("attr-name", "supported-streaming-protocols"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportContentLauncherSupportedStreamingProtocols() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050A) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::ContentLauncherCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint32_t value) - { - DataModelLogger::LogValue("ContentLauncher.SupportedStreamingProtocols report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadContentLauncherAttributeList : public ModelCommand -{ -public: - ReadContentLauncherAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadContentLauncherAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050A) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::ContentLauncherCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "ContentLauncher.AttributeList response", value); - } -}; - -class ReportContentLauncherAttributeList : public ModelCommand -{ -public: - ReportContentLauncherAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportContentLauncherAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050A) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::ContentLauncherCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("ContentLauncher.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadContentLauncherClusterRevision : public ModelCommand -{ -public: - ReadContentLauncherClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadContentLauncherClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050A) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::ContentLauncherCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ContentLauncher.ClusterRevision response", value); - } -}; - -class ReportContentLauncherClusterRevision : public ModelCommand -{ -public: - ReportContentLauncherClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportContentLauncherClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050A) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::ContentLauncherCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ContentLauncher.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster Descriptor | 0x001D | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * DeviceList | 0x0000 | -| * ServerList | 0x0001 | -| * ClientList | 0x0002 | -| * PartsList | 0x0003 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Attribute DeviceList - */ -class ReadDescriptorDeviceList : public ModelCommand -{ -public: - ReadDescriptorDeviceList() : ModelCommand("read") - { - AddArgument("attr-name", "device-list"); - ModelCommand::AddArguments(); - } - - ~ReadDescriptorDeviceList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001D) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::DescriptorCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse( - void * context, - const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "Descriptor.DeviceList response", value); - } -}; - -class ReportDescriptorDeviceList : public ModelCommand -{ -public: - ReportDescriptorDeviceList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "device-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDescriptorDeviceList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001D) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::DescriptorCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport( - void * context, - const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("Descriptor.DeviceList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ServerList - */ -class ReadDescriptorServerList : public ModelCommand -{ -public: - ReadDescriptorServerList() : ModelCommand("read") - { - AddArgument("attr-name", "server-list"); - ModelCommand::AddArguments(); - } - - ~ReadDescriptorServerList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001D) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::DescriptorCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "Descriptor.ServerList response", value); - } -}; - -class ReportDescriptorServerList : public ModelCommand -{ -public: - ReportDescriptorServerList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "server-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDescriptorServerList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001D) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::DescriptorCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("Descriptor.ServerList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClientList - */ -class ReadDescriptorClientList : public ModelCommand -{ -public: - ReadDescriptorClientList() : ModelCommand("read") - { - AddArgument("attr-name", "client-list"); - ModelCommand::AddArguments(); - } - - ~ReadDescriptorClientList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001D) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::DescriptorCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "Descriptor.ClientList response", value); - } -}; - -class ReportDescriptorClientList : public ModelCommand -{ -public: - ReportDescriptorClientList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "client-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDescriptorClientList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001D) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::DescriptorCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("Descriptor.ClientList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute PartsList - */ -class ReadDescriptorPartsList : public ModelCommand -{ -public: - ReadDescriptorPartsList() : ModelCommand("read") - { - AddArgument("attr-name", "parts-list"); - ModelCommand::AddArguments(); - } - - ~ReadDescriptorPartsList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001D) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::DescriptorCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "Descriptor.PartsList response", value); - } -}; - -class ReportDescriptorPartsList : public ModelCommand -{ -public: - ReportDescriptorPartsList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "parts-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDescriptorPartsList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001D) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::DescriptorCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("Descriptor.PartsList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadDescriptorAttributeList : public ModelCommand -{ -public: - ReadDescriptorAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadDescriptorAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001D) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::DescriptorCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "Descriptor.AttributeList response", value); - } -}; - -class ReportDescriptorAttributeList : public ModelCommand -{ -public: - ReportDescriptorAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDescriptorAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001D) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::DescriptorCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("Descriptor.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadDescriptorClusterRevision : public ModelCommand -{ -public: - ReadDescriptorClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadDescriptorClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001D) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::DescriptorCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "Descriptor.ClusterRevision response", value); - } -}; - -class ReportDescriptorClusterRevision : public ModelCommand -{ -public: - ReportDescriptorClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDescriptorClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000001D) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::DescriptorCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("Descriptor.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster DiagnosticLogs | 0x0032 | -|------------------------------------------------------------------------------| -| Commands: | | -| * RetrieveLogsRequest | 0x00 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * AttributeList | 0xFFFB | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command RetrieveLogsRequest - */ -class DiagnosticLogsRetrieveLogsRequest : public ModelCommand -{ -public: - DiagnosticLogsRetrieveLogsRequest() : ModelCommand("retrieve-logs-request") - { - AddArgument("Intent", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.intent)); - AddArgument("RequestedProtocol", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.requestedProtocol)); - AddArgument("TransferFileDesignator", &mRequest.transferFileDesignator); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000032) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDiagnosticLogsRetrieveLogsResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsRequest::Type mRequest; -}; - -/* - * Attribute AttributeList - */ -class ReadDiagnosticLogsAttributeList : public ModelCommand -{ -public: - ReadDiagnosticLogsAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadDiagnosticLogsAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000032) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::DiagnosticLogsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "DiagnosticLogs.AttributeList response", value); - } -}; - -class ReportDiagnosticLogsAttributeList : public ModelCommand -{ -public: - ReportDiagnosticLogsAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDiagnosticLogsAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000032) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::DiagnosticLogsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("DiagnosticLogs.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster DoorLock | 0x0101 | -|------------------------------------------------------------------------------| -| Commands: | | -| * ClearCredential | 0x26 | -| * ClearUser | 0x1D | -| * GetCredentialStatus | 0x24 | -| * GetUser | 0x1B | -| * LockDoor | 0x00 | -| * SetCredential | 0x22 | -| * SetUser | 0x1A | -| * UnlockDoor | 0x01 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * LockState | 0x0000 | -| * LockType | 0x0001 | -| * ActuatorEnabled | 0x0002 | -| * DoorState | 0x0003 | -| * NumberOfTotalUsersSupported | 0x0011 | -| * NumberOfPINUsersSupported | 0x0012 | -| * MaxPINCodeLength | 0x0017 | -| * MinPINCodeLength | 0x0018 | -| * Language | 0x0021 | -| * AutoRelockTime | 0x0023 | -| * SoundVolume | 0x0024 | -| * OperatingMode | 0x0025 | -| * SupportedOperatingModes | 0x0026 | -| * EnableOneTouchLocking | 0x0029 | -| * EnablePrivacyModeButton | 0x002B | -| * WrongCodeEntryLimit | 0x0030 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -| * DoorLockAlarm | 0x0000 | -| * DoorStateChange | 0x0001 | -| * LockOperation | 0x0002 | -| * LockOperationError | 0x0003 | -| * LockUserChange | 0x0004 | -\*----------------------------------------------------------------------------*/ - -/* - * Command ClearCredential - */ -class DoorLockClearCredential : public ModelCommand -{ -public: - DoorLockClearCredential() : ModelCommand("clear-credential"), mComplex_Credential(&mRequest.credential) - { - AddArgument("Credential", &mComplex_Credential); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000026) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::DoorLock::Commands::ClearCredential::Type mRequest; - TypedComplexArgument mComplex_Credential; -}; - -/* - * Command ClearUser - */ -class DoorLockClearUser : public ModelCommand -{ -public: - DoorLockClearUser() : ModelCommand("clear-user") - { - AddArgument("UserIndex", 0, UINT16_MAX, &mRequest.userIndex); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x0000001D) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::DoorLock::Commands::ClearUser::Type mRequest; -}; - -/* - * Command GetCredentialStatus - */ -class DoorLockGetCredentialStatus : public ModelCommand -{ -public: - DoorLockGetCredentialStatus() : ModelCommand("get-credential-status"), mComplex_Credential(&mRequest.credential) - { - AddArgument("Credential", &mComplex_Credential); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000024) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDoorLockGetCredentialStatusResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type mRequest; - TypedComplexArgument mComplex_Credential; -}; - -/* - * Command GetUser - */ -class DoorLockGetUser : public ModelCommand -{ -public: - DoorLockGetUser() : ModelCommand("get-user") - { - AddArgument("UserIndex", 0, UINT16_MAX, &mRequest.userIndex); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x0000001B) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDoorLockGetUserResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::DoorLock::Commands::GetUser::Type mRequest; -}; - -/* - * Command LockDoor - */ -class DoorLockLockDoor : public ModelCommand -{ -public: - DoorLockLockDoor() : ModelCommand("lock-door") - { - AddArgument("PinCode", &mRequest.pinCode); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::DoorLock::Commands::LockDoor::Type mRequest; -}; - -/* - * Command SetCredential - */ -class DoorLockSetCredential : public ModelCommand -{ -public: - DoorLockSetCredential() : ModelCommand("set-credential"), mComplex_Credential(&mRequest.credential) - { - AddArgument("OperationType", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.operationType)); - AddArgument("Credential", &mComplex_Credential); - AddArgument("CredentialData", &mRequest.credentialData); - AddArgument("UserIndex", 0, UINT16_MAX, &mRequest.userIndex); - AddArgument("UserStatus", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.userStatus)); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000022) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDoorLockSetCredentialResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::DoorLock::Commands::SetCredential::Type mRequest; - TypedComplexArgument mComplex_Credential; -}; - -/* - * Command SetUser - */ -class DoorLockSetUser : public ModelCommand -{ -public: - DoorLockSetUser() : ModelCommand("set-user") - { - AddArgument("OperationType", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.operationType)); - AddArgument("UserIndex", 0, UINT16_MAX, &mRequest.userIndex); - AddArgument("UserName", &mRequest.userName); - AddArgument("UserUniqueId", 0, UINT32_MAX, &mRequest.userUniqueId); - AddArgument("UserStatus", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.userStatus)); - AddArgument("UserType", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.userType)); - AddArgument("CredentialRule", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.credentialRule)); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x0000001A) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::DoorLock::Commands::SetUser::Type mRequest; -}; - -/* - * Command UnlockDoor - */ -class DoorLockUnlockDoor : public ModelCommand -{ -public: - DoorLockUnlockDoor() : ModelCommand("unlock-door") - { - AddArgument("PinCode", &mRequest.pinCode); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000001) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type mRequest; -}; - -/* - * Event DoorLockAlarm - */ -class ReadDoorLockDoorLockAlarm : public ModelCommand -{ -public: - ReadDoorLockDoorLockAlarm() : ModelCommand("read-event") - { - AddArgument("event-name", "door-lock-alarm"); - ModelCommand::AddArguments(); - } - - ~ReadDoorLockDoorLockAlarm() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadEvent (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent(this, OnEventResponse, - OnDefaultFailure); - } - - static void OnEventResponse(void * context, chip::app::Clusters::DoorLock::Events::DoorLockAlarm::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "DoorLock.DoorLockAlarm response", value); - } -}; - -class ReportDoorLockDoorLockAlarm : public ModelCommand -{ -public: - ReportDoorLockDoorLockAlarm() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "door-lock-alarm"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDoorLockDoorLockAlarm() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportEvent (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::DoorLock::Events::DoorLockAlarm::DecodableType value) - { - DataModelLogger::LogValue("DoorLock.DoorLockAlarm report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event DoorStateChange - */ -class ReadDoorLockDoorStateChange : public ModelCommand -{ -public: - ReadDoorLockDoorStateChange() : ModelCommand("read-event") - { - AddArgument("event-name", "door-state-change"); - ModelCommand::AddArguments(); - } - - ~ReadDoorLockDoorStateChange() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadEvent (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent(this, OnEventResponse, - OnDefaultFailure); - } - - static void OnEventResponse(void * context, chip::app::Clusters::DoorLock::Events::DoorStateChange::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "DoorLock.DoorStateChange response", value); - } -}; - -class ReportDoorLockDoorStateChange : public ModelCommand -{ -public: - ReportDoorLockDoorStateChange() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "door-state-change"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDoorLockDoorStateChange() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportEvent (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::DoorLock::Events::DoorStateChange::DecodableType value) - { - DataModelLogger::LogValue("DoorLock.DoorStateChange report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event LockOperation - */ -class ReadDoorLockLockOperation : public ModelCommand -{ -public: - ReadDoorLockLockOperation() : ModelCommand("read-event") - { - AddArgument("event-name", "lock-operation"); - ModelCommand::AddArguments(); - } - - ~ReadDoorLockLockOperation() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadEvent (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent(this, OnEventResponse, - OnDefaultFailure); - } - - static void OnEventResponse(void * context, chip::app::Clusters::DoorLock::Events::LockOperation::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "DoorLock.LockOperation response", value); - } -}; - -class ReportDoorLockLockOperation : public ModelCommand -{ -public: - ReportDoorLockLockOperation() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "lock-operation"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDoorLockLockOperation() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportEvent (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::DoorLock::Events::LockOperation::DecodableType value) - { - DataModelLogger::LogValue("DoorLock.LockOperation report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event LockOperationError - */ -class ReadDoorLockLockOperationError : public ModelCommand -{ -public: - ReadDoorLockLockOperationError() : ModelCommand("read-event") - { - AddArgument("event-name", "lock-operation-error"); - ModelCommand::AddArguments(); - } - - ~ReadDoorLockLockOperationError() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadEvent (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent(this, OnEventResponse, - OnDefaultFailure); - } - - static void OnEventResponse(void * context, chip::app::Clusters::DoorLock::Events::LockOperationError::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "DoorLock.LockOperationError response", value); - } -}; - -class ReportDoorLockLockOperationError : public ModelCommand -{ -public: - ReportDoorLockLockOperationError() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "lock-operation-error"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDoorLockLockOperationError() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportEvent (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::DoorLock::Events::LockOperationError::DecodableType value) - { - DataModelLogger::LogValue("DoorLock.LockOperationError report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event LockUserChange - */ -class ReadDoorLockLockUserChange : public ModelCommand -{ -public: - ReadDoorLockLockUserChange() : ModelCommand("read-event") - { - AddArgument("event-name", "lock-user-change"); - ModelCommand::AddArguments(); - } - - ~ReadDoorLockLockUserChange() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadEvent (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent(this, OnEventResponse, - OnDefaultFailure); - } - - static void OnEventResponse(void * context, chip::app::Clusters::DoorLock::Events::LockUserChange::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "DoorLock.LockUserChange response", value); - } -}; - -class ReportDoorLockLockUserChange : public ModelCommand -{ -public: - ReportDoorLockLockUserChange() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "lock-user-change"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDoorLockLockUserChange() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportEvent (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::DoorLock::Events::LockUserChange::DecodableType value) - { - DataModelLogger::LogValue("DoorLock.LockUserChange report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute LockState - */ -class ReadDoorLockLockState : public ModelCommand -{ -public: - ReadDoorLockLockState() : ModelCommand("read") - { - AddArgument("attr-name", "lock-state"); - ModelCommand::AddArguments(); - } - - ~ReadDoorLockLockState() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, - const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "DoorLock.LockState response", value); - } -}; - -class ReportDoorLockLockState : public ModelCommand -{ -public: - ReportDoorLockLockState() : ModelCommand("subscribe") - { - AddArgument("attr-name", "lock-state"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDoorLockLockState() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("DoorLock.LockState report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute LockType - */ -class ReadDoorLockLockType : public ModelCommand -{ -public: - ReadDoorLockLockType() : ModelCommand("read") - { - AddArgument("attr-name", "lock-type"); - ModelCommand::AddArguments(); - } - - ~ReadDoorLockLockType() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::app::Clusters::DoorLock::DlLockType value) - { - OnGeneralAttributeEventResponse(context, "DoorLock.LockType response", value); - } -}; - -class ReportDoorLockLockType : public ModelCommand -{ -public: - ReportDoorLockLockType() : ModelCommand("subscribe") - { - AddArgument("attr-name", "lock-type"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDoorLockLockType() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::DoorLock::DlLockType value) - { - DataModelLogger::LogValue("DoorLock.LockType report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ActuatorEnabled - */ -class ReadDoorLockActuatorEnabled : public ModelCommand -{ -public: - ReadDoorLockActuatorEnabled() : ModelCommand("read") - { - AddArgument("attr-name", "actuator-enabled"); - ModelCommand::AddArguments(); - } - - ~ReadDoorLockActuatorEnabled() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, bool value) - { - OnGeneralAttributeEventResponse(context, "DoorLock.ActuatorEnabled response", value); - } -}; - -class ReportDoorLockActuatorEnabled : public ModelCommand -{ -public: - ReportDoorLockActuatorEnabled() : ModelCommand("subscribe") - { - AddArgument("attr-name", "actuator-enabled"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDoorLockActuatorEnabled() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, bool value) - { - DataModelLogger::LogValue("DoorLock.ActuatorEnabled report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute DoorState - */ -class ReadDoorLockDoorState : public ModelCommand -{ -public: - ReadDoorLockDoorState() : ModelCommand("read") - { - AddArgument("attr-name", "door-state"); - ModelCommand::AddArguments(); - } - - ~ReadDoorLockDoorState() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, - const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "DoorLock.DoorState response", value); - } -}; - -class ReportDoorLockDoorState : public ModelCommand -{ -public: - ReportDoorLockDoorState() : ModelCommand("subscribe") - { - AddArgument("attr-name", "door-state"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDoorLockDoorState() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("DoorLock.DoorState report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NumberOfTotalUsersSupported - */ -class ReadDoorLockNumberOfTotalUsersSupported : public ModelCommand -{ -public: - ReadDoorLockNumberOfTotalUsersSupported() : ModelCommand("read") - { - AddArgument("attr-name", "number-of-total-users-supported"); - ModelCommand::AddArguments(); - } - - ~ReadDoorLockNumberOfTotalUsersSupported() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000011) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "DoorLock.NumberOfTotalUsersSupported response", value); - } -}; - -class ReportDoorLockNumberOfTotalUsersSupported : public ModelCommand -{ -public: - ReportDoorLockNumberOfTotalUsersSupported() : ModelCommand("subscribe") - { - AddArgument("attr-name", "number-of-total-users-supported"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDoorLockNumberOfTotalUsersSupported() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000011) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("DoorLock.NumberOfTotalUsersSupported report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NumberOfPINUsersSupported - */ -class ReadDoorLockNumberOfPINUsersSupported : public ModelCommand -{ -public: - ReadDoorLockNumberOfPINUsersSupported() : ModelCommand("read") - { - AddArgument("attr-name", "number-of-pinusers-supported"); - ModelCommand::AddArguments(); - } - - ~ReadDoorLockNumberOfPINUsersSupported() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000012) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "DoorLock.NumberOfPINUsersSupported response", value); - } -}; - -class ReportDoorLockNumberOfPINUsersSupported : public ModelCommand -{ -public: - ReportDoorLockNumberOfPINUsersSupported() : ModelCommand("subscribe") - { - AddArgument("attr-name", "number-of-pinusers-supported"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDoorLockNumberOfPINUsersSupported() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000012) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("DoorLock.NumberOfPINUsersSupported report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MaxPINCodeLength - */ -class ReadDoorLockMaxPINCodeLength : public ModelCommand -{ -public: - ReadDoorLockMaxPINCodeLength() : ModelCommand("read") - { - AddArgument("attr-name", "max-pincode-length"); - ModelCommand::AddArguments(); - } - - ~ReadDoorLockMaxPINCodeLength() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000017) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "DoorLock.MaxPINCodeLength response", value); - } -}; - -class ReportDoorLockMaxPINCodeLength : public ModelCommand -{ -public: - ReportDoorLockMaxPINCodeLength() : ModelCommand("subscribe") - { - AddArgument("attr-name", "max-pincode-length"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDoorLockMaxPINCodeLength() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000017) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("DoorLock.MaxPINCodeLength report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MinPINCodeLength - */ -class ReadDoorLockMinPINCodeLength : public ModelCommand -{ -public: - ReadDoorLockMinPINCodeLength() : ModelCommand("read") - { - AddArgument("attr-name", "min-pincode-length"); - ModelCommand::AddArguments(); - } - - ~ReadDoorLockMinPINCodeLength() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000018) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "DoorLock.MinPINCodeLength response", value); - } -}; - -class ReportDoorLockMinPINCodeLength : public ModelCommand -{ -public: - ReportDoorLockMinPINCodeLength() : ModelCommand("subscribe") - { - AddArgument("attr-name", "min-pincode-length"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDoorLockMinPINCodeLength() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000018) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("DoorLock.MinPINCodeLength report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Language - */ -class ReadDoorLockLanguage : public ModelCommand -{ -public: - ReadDoorLockLanguage() : ModelCommand("read") - { - AddArgument("attr-name", "language"); - ModelCommand::AddArguments(); - } - - ~ReadDoorLockLanguage() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000021) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::CharSpan value) - { - OnGeneralAttributeEventResponse(context, "DoorLock.Language response", value); - } -}; - -class WriteDoorLockLanguage : public ModelCommand -{ -public: - WriteDoorLockLanguage() : ModelCommand("write") - { - AddArgument("attr-name", "language"); - AddArgument("attr-value", &mValue); - ModelCommand::AddArguments(); - } - - ~WriteDoorLockLanguage() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000021) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::CharSpan mValue; -}; - -class ReportDoorLockLanguage : public ModelCommand -{ -public: - ReportDoorLockLanguage() : ModelCommand("subscribe") - { - AddArgument("attr-name", "language"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDoorLockLanguage() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000021) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::CharSpan value) - { - DataModelLogger::LogValue("DoorLock.Language report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AutoRelockTime - */ -class ReadDoorLockAutoRelockTime : public ModelCommand -{ -public: - ReadDoorLockAutoRelockTime() : ModelCommand("read") - { - AddArgument("attr-name", "auto-relock-time"); - ModelCommand::AddArguments(); - } - - ~ReadDoorLockAutoRelockTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000023) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint32_t value) - { - OnGeneralAttributeEventResponse(context, "DoorLock.AutoRelockTime response", value); - } -}; - -class WriteDoorLockAutoRelockTime : public ModelCommand -{ -public: - WriteDoorLockAutoRelockTime() : ModelCommand("write") - { - AddArgument("attr-name", "auto-relock-time"); - AddArgument("attr-value", 0, UINT32_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteDoorLockAutoRelockTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000023) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint32_t mValue; -}; - -class ReportDoorLockAutoRelockTime : public ModelCommand -{ -public: - ReportDoorLockAutoRelockTime() : ModelCommand("subscribe") - { - AddArgument("attr-name", "auto-relock-time"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDoorLockAutoRelockTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000023) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint32_t value) - { - DataModelLogger::LogValue("DoorLock.AutoRelockTime report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute SoundVolume - */ -class ReadDoorLockSoundVolume : public ModelCommand -{ -public: - ReadDoorLockSoundVolume() : ModelCommand("read") - { - AddArgument("attr-name", "sound-volume"); - ModelCommand::AddArguments(); - } - - ~ReadDoorLockSoundVolume() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000024) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "DoorLock.SoundVolume response", value); - } -}; - -class WriteDoorLockSoundVolume : public ModelCommand -{ -public: - WriteDoorLockSoundVolume() : ModelCommand("write") - { - AddArgument("attr-name", "sound-volume"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteDoorLockSoundVolume() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000024) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint8_t mValue; -}; - -class ReportDoorLockSoundVolume : public ModelCommand -{ -public: - ReportDoorLockSoundVolume() : ModelCommand("subscribe") - { - AddArgument("attr-name", "sound-volume"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDoorLockSoundVolume() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000024) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) { DataModelLogger::LogValue("DoorLock.SoundVolume report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute OperatingMode - */ -class ReadDoorLockOperatingMode : public ModelCommand -{ -public: - ReadDoorLockOperatingMode() : ModelCommand("read") - { - AddArgument("attr-name", "operating-mode"); - ModelCommand::AddArguments(); - } - - ~ReadDoorLockOperatingMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000025) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::app::Clusters::DoorLock::DlOperatingMode value) - { - OnGeneralAttributeEventResponse(context, "DoorLock.OperatingMode response", value); - } -}; - -class WriteDoorLockOperatingMode : public ModelCommand -{ -public: - WriteDoorLockOperatingMode() : ModelCommand("write") - { - AddArgument("attr-name", "operating-mode"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteDoorLockOperatingMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000025) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::DoorLock::DlOperatingMode mValue; -}; - -class ReportDoorLockOperatingMode : public ModelCommand -{ -public: - ReportDoorLockOperatingMode() : ModelCommand("subscribe") - { - AddArgument("attr-name", "operating-mode"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDoorLockOperatingMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000025) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::DoorLock::DlOperatingMode value) - { - DataModelLogger::LogValue("DoorLock.OperatingMode report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute SupportedOperatingModes - */ -class ReadDoorLockSupportedOperatingModes : public ModelCommand -{ -public: - ReadDoorLockSupportedOperatingModes() : ModelCommand("read") - { - AddArgument("attr-name", "supported-operating-modes"); - ModelCommand::AddArguments(); - } - - ~ReadDoorLockSupportedOperatingModes() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000026) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "DoorLock.SupportedOperatingModes response", value); - } -}; - -class ReportDoorLockSupportedOperatingModes : public ModelCommand -{ -public: - ReportDoorLockSupportedOperatingModes() : ModelCommand("subscribe") - { - AddArgument("attr-name", "supported-operating-modes"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDoorLockSupportedOperatingModes() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000026) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("DoorLock.SupportedOperatingModes report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute EnableOneTouchLocking - */ -class ReadDoorLockEnableOneTouchLocking : public ModelCommand -{ -public: - ReadDoorLockEnableOneTouchLocking() : ModelCommand("read") - { - AddArgument("attr-name", "enable-one-touch-locking"); - ModelCommand::AddArguments(); - } - - ~ReadDoorLockEnableOneTouchLocking() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000029) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, bool value) - { - OnGeneralAttributeEventResponse(context, "DoorLock.EnableOneTouchLocking response", value); - } -}; - -class WriteDoorLockEnableOneTouchLocking : public ModelCommand -{ -public: - WriteDoorLockEnableOneTouchLocking() : ModelCommand("write") - { - AddArgument("attr-name", "enable-one-touch-locking"); - AddArgument("attr-value", 0, 1, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteDoorLockEnableOneTouchLocking() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000029) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - bool mValue; -}; - -class ReportDoorLockEnableOneTouchLocking : public ModelCommand -{ -public: - ReportDoorLockEnableOneTouchLocking() : ModelCommand("subscribe") - { - AddArgument("attr-name", "enable-one-touch-locking"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDoorLockEnableOneTouchLocking() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000029) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, bool value) - { - DataModelLogger::LogValue("DoorLock.EnableOneTouchLocking report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute EnablePrivacyModeButton - */ -class ReadDoorLockEnablePrivacyModeButton : public ModelCommand -{ -public: - ReadDoorLockEnablePrivacyModeButton() : ModelCommand("read") - { - AddArgument("attr-name", "enable-privacy-mode-button"); - ModelCommand::AddArguments(); - } - - ~ReadDoorLockEnablePrivacyModeButton() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x0000002B) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, bool value) - { - OnGeneralAttributeEventResponse(context, "DoorLock.EnablePrivacyModeButton response", value); - } -}; - -class WriteDoorLockEnablePrivacyModeButton : public ModelCommand -{ -public: - WriteDoorLockEnablePrivacyModeButton() : ModelCommand("write") - { - AddArgument("attr-name", "enable-privacy-mode-button"); - AddArgument("attr-value", 0, 1, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteDoorLockEnablePrivacyModeButton() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x0000002B) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - bool mValue; -}; - -class ReportDoorLockEnablePrivacyModeButton : public ModelCommand -{ -public: - ReportDoorLockEnablePrivacyModeButton() : ModelCommand("subscribe") - { - AddArgument("attr-name", "enable-privacy-mode-button"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDoorLockEnablePrivacyModeButton() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x0000002B) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, bool value) - { - DataModelLogger::LogValue("DoorLock.EnablePrivacyModeButton report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute WrongCodeEntryLimit - */ -class ReadDoorLockWrongCodeEntryLimit : public ModelCommand -{ -public: - ReadDoorLockWrongCodeEntryLimit() : ModelCommand("read") - { - AddArgument("attr-name", "wrong-code-entry-limit"); - ModelCommand::AddArguments(); - } - - ~ReadDoorLockWrongCodeEntryLimit() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x00000030) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "DoorLock.WrongCodeEntryLimit response", value); - } -}; - -class WriteDoorLockWrongCodeEntryLimit : public ModelCommand -{ -public: - WriteDoorLockWrongCodeEntryLimit() : ModelCommand("write") - { - AddArgument("attr-name", "wrong-code-entry-limit"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteDoorLockWrongCodeEntryLimit() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) WriteAttribute (0x00000030) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint8_t mValue; -}; - -class ReportDoorLockWrongCodeEntryLimit : public ModelCommand -{ -public: - ReportDoorLockWrongCodeEntryLimit() : ModelCommand("subscribe") - { - AddArgument("attr-name", "wrong-code-entry-limit"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDoorLockWrongCodeEntryLimit() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x00000030) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("DoorLock.WrongCodeEntryLimit report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadDoorLockAttributeList : public ModelCommand -{ -public: - ReadDoorLockAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadDoorLockAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "DoorLock.AttributeList response", value); - } -}; - -class ReportDoorLockAttributeList : public ModelCommand -{ -public: - ReportDoorLockAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDoorLockAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("DoorLock.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadDoorLockClusterRevision : public ModelCommand -{ -public: - ReadDoorLockClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadDoorLockClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "DoorLock.ClusterRevision response", value); - } -}; - -class ReportDoorLockClusterRevision : public ModelCommand -{ -public: - ReportDoorLockClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportDoorLockClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000101) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::DoorLockCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("DoorLock.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster ElectricalMeasurement | 0x0B04 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * MeasurementType | 0x0000 | -| * TotalActivePower | 0x0304 | -| * RmsVoltage | 0x0505 | -| * RmsVoltageMin | 0x0506 | -| * RmsVoltageMax | 0x0507 | -| * RmsCurrent | 0x0508 | -| * RmsCurrentMin | 0x0509 | -| * RmsCurrentMax | 0x050A | -| * ActivePower | 0x050B | -| * ActivePowerMin | 0x050C | -| * ActivePowerMax | 0x050D | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Attribute MeasurementType - */ -class ReadElectricalMeasurementMeasurementType : public ModelCommand -{ -public: - ReadElectricalMeasurementMeasurementType() : ModelCommand("read") - { - AddArgument("attr-name", "measurement-type"); - ModelCommand::AddArguments(); - } - - ~ReadElectricalMeasurementMeasurementType() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint32_t value) - { - OnGeneralAttributeEventResponse(context, "ElectricalMeasurement.MeasurementType response", value); - } -}; - -class ReportElectricalMeasurementMeasurementType : public ModelCommand -{ -public: - ReportElectricalMeasurementMeasurementType() : ModelCommand("subscribe") - { - AddArgument("attr-name", "measurement-type"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportElectricalMeasurementMeasurementType() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint32_t value) - { - DataModelLogger::LogValue("ElectricalMeasurement.MeasurementType report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute TotalActivePower - */ -class ReadElectricalMeasurementTotalActivePower : public ModelCommand -{ -public: - ReadElectricalMeasurementTotalActivePower() : ModelCommand("read") - { - AddArgument("attr-name", "total-active-power"); - ModelCommand::AddArguments(); - } - - ~ReadElectricalMeasurementTotalActivePower() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000304) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int32_t value) - { - OnGeneralAttributeEventResponse(context, "ElectricalMeasurement.TotalActivePower response", value); - } -}; - -class ReportElectricalMeasurementTotalActivePower : public ModelCommand -{ -public: - ReportElectricalMeasurementTotalActivePower() : ModelCommand("subscribe") - { - AddArgument("attr-name", "total-active-power"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportElectricalMeasurementTotalActivePower() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000304) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int32_t value) - { - DataModelLogger::LogValue("ElectricalMeasurement.TotalActivePower report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute RmsVoltage - */ -class ReadElectricalMeasurementRmsVoltage : public ModelCommand -{ -public: - ReadElectricalMeasurementRmsVoltage() : ModelCommand("read") - { - AddArgument("attr-name", "rms-voltage"); - ModelCommand::AddArguments(); - } - - ~ReadElectricalMeasurementRmsVoltage() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000505) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ElectricalMeasurement.RmsVoltage response", value); - } -}; - -class ReportElectricalMeasurementRmsVoltage : public ModelCommand -{ -public: - ReportElectricalMeasurementRmsVoltage() : ModelCommand("subscribe") - { - AddArgument("attr-name", "rms-voltage"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportElectricalMeasurementRmsVoltage() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000505) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ElectricalMeasurement.RmsVoltage report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute RmsVoltageMin - */ -class ReadElectricalMeasurementRmsVoltageMin : public ModelCommand -{ -public: - ReadElectricalMeasurementRmsVoltageMin() : ModelCommand("read") - { - AddArgument("attr-name", "rms-voltage-min"); - ModelCommand::AddArguments(); - } - - ~ReadElectricalMeasurementRmsVoltageMin() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000506) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ElectricalMeasurement.RmsVoltageMin response", value); - } -}; - -class ReportElectricalMeasurementRmsVoltageMin : public ModelCommand -{ -public: - ReportElectricalMeasurementRmsVoltageMin() : ModelCommand("subscribe") - { - AddArgument("attr-name", "rms-voltage-min"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportElectricalMeasurementRmsVoltageMin() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000506) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ElectricalMeasurement.RmsVoltageMin report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute RmsVoltageMax - */ -class ReadElectricalMeasurementRmsVoltageMax : public ModelCommand -{ -public: - ReadElectricalMeasurementRmsVoltageMax() : ModelCommand("read") - { - AddArgument("attr-name", "rms-voltage-max"); - ModelCommand::AddArguments(); - } - - ~ReadElectricalMeasurementRmsVoltageMax() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000507) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ElectricalMeasurement.RmsVoltageMax response", value); - } -}; - -class ReportElectricalMeasurementRmsVoltageMax : public ModelCommand -{ -public: - ReportElectricalMeasurementRmsVoltageMax() : ModelCommand("subscribe") - { - AddArgument("attr-name", "rms-voltage-max"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportElectricalMeasurementRmsVoltageMax() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000507) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ElectricalMeasurement.RmsVoltageMax report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute RmsCurrent - */ -class ReadElectricalMeasurementRmsCurrent : public ModelCommand -{ -public: - ReadElectricalMeasurementRmsCurrent() : ModelCommand("read") - { - AddArgument("attr-name", "rms-current"); - ModelCommand::AddArguments(); - } - - ~ReadElectricalMeasurementRmsCurrent() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000508) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ElectricalMeasurement.RmsCurrent response", value); - } -}; - -class ReportElectricalMeasurementRmsCurrent : public ModelCommand -{ -public: - ReportElectricalMeasurementRmsCurrent() : ModelCommand("subscribe") - { - AddArgument("attr-name", "rms-current"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportElectricalMeasurementRmsCurrent() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000508) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ElectricalMeasurement.RmsCurrent report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute RmsCurrentMin - */ -class ReadElectricalMeasurementRmsCurrentMin : public ModelCommand -{ -public: - ReadElectricalMeasurementRmsCurrentMin() : ModelCommand("read") - { - AddArgument("attr-name", "rms-current-min"); - ModelCommand::AddArguments(); - } - - ~ReadElectricalMeasurementRmsCurrentMin() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x00000509) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ElectricalMeasurement.RmsCurrentMin response", value); - } -}; - -class ReportElectricalMeasurementRmsCurrentMin : public ModelCommand -{ -public: - ReportElectricalMeasurementRmsCurrentMin() : ModelCommand("subscribe") - { - AddArgument("attr-name", "rms-current-min"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportElectricalMeasurementRmsCurrentMin() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x00000509) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ElectricalMeasurement.RmsCurrentMin report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute RmsCurrentMax - */ -class ReadElectricalMeasurementRmsCurrentMax : public ModelCommand -{ -public: - ReadElectricalMeasurementRmsCurrentMax() : ModelCommand("read") - { - AddArgument("attr-name", "rms-current-max"); - ModelCommand::AddArguments(); - } - - ~ReadElectricalMeasurementRmsCurrentMax() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000050A) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ElectricalMeasurement.RmsCurrentMax response", value); - } -}; - -class ReportElectricalMeasurementRmsCurrentMax : public ModelCommand -{ -public: - ReportElectricalMeasurementRmsCurrentMax() : ModelCommand("subscribe") - { - AddArgument("attr-name", "rms-current-max"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportElectricalMeasurementRmsCurrentMax() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000050A) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ElectricalMeasurement.RmsCurrentMax report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ActivePower - */ -class ReadElectricalMeasurementActivePower : public ModelCommand -{ -public: - ReadElectricalMeasurementActivePower() : ModelCommand("read") - { - AddArgument("attr-name", "active-power"); - ModelCommand::AddArguments(); - } - - ~ReadElectricalMeasurementActivePower() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000050B) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "ElectricalMeasurement.ActivePower response", value); - } -}; - -class ReportElectricalMeasurementActivePower : public ModelCommand -{ -public: - ReportElectricalMeasurementActivePower() : ModelCommand("subscribe") - { - AddArgument("attr-name", "active-power"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportElectricalMeasurementActivePower() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000050B) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("ElectricalMeasurement.ActivePower report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ActivePowerMin - */ -class ReadElectricalMeasurementActivePowerMin : public ModelCommand -{ -public: - ReadElectricalMeasurementActivePowerMin() : ModelCommand("read") - { - AddArgument("attr-name", "active-power-min"); - ModelCommand::AddArguments(); - } - - ~ReadElectricalMeasurementActivePowerMin() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000050C) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "ElectricalMeasurement.ActivePowerMin response", value); - } -}; - -class ReportElectricalMeasurementActivePowerMin : public ModelCommand -{ -public: - ReportElectricalMeasurementActivePowerMin() : ModelCommand("subscribe") - { - AddArgument("attr-name", "active-power-min"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportElectricalMeasurementActivePowerMin() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000050C) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("ElectricalMeasurement.ActivePowerMin report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ActivePowerMax - */ -class ReadElectricalMeasurementActivePowerMax : public ModelCommand -{ -public: - ReadElectricalMeasurementActivePowerMax() : ModelCommand("read") - { - AddArgument("attr-name", "active-power-max"); - ModelCommand::AddArguments(); - } - - ~ReadElectricalMeasurementActivePowerMax() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000050D) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "ElectricalMeasurement.ActivePowerMax response", value); - } -}; - -class ReportElectricalMeasurementActivePowerMax : public ModelCommand -{ -public: - ReportElectricalMeasurementActivePowerMax() : ModelCommand("subscribe") - { - AddArgument("attr-name", "active-power-max"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportElectricalMeasurementActivePowerMax() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000050D) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("ElectricalMeasurement.ActivePowerMax report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadElectricalMeasurementAttributeList : public ModelCommand -{ -public: - ReadElectricalMeasurementAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadElectricalMeasurementAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "ElectricalMeasurement.AttributeList response", value); - } -}; - -class ReportElectricalMeasurementAttributeList : public ModelCommand -{ -public: - ReportElectricalMeasurementAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportElectricalMeasurementAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("ElectricalMeasurement.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadElectricalMeasurementClusterRevision : public ModelCommand -{ -public: - ReadElectricalMeasurementClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadElectricalMeasurementClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ElectricalMeasurement.ClusterRevision response", value); - } -}; - -class ReportElectricalMeasurementClusterRevision : public ModelCommand -{ -public: - ReportElectricalMeasurementClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportElectricalMeasurementClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000B04) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::ElectricalMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ElectricalMeasurement.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster EthernetNetworkDiagnostics | 0x0037 | -|------------------------------------------------------------------------------| -| Commands: | | -| * ResetCounts | 0x00 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * PHYRate | 0x0000 | -| * FullDuplex | 0x0001 | -| * PacketRxCount | 0x0002 | -| * PacketTxCount | 0x0003 | -| * TxErrCount | 0x0004 | -| * CollisionCount | 0x0005 | -| * OverrunCount | 0x0006 | -| * CarrierDetect | 0x0007 | -| * TimeSinceReset | 0x0008 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command ResetCounts - */ -class EthernetNetworkDiagnosticsResetCounts : public ModelCommand -{ -public: - EthernetNetworkDiagnosticsResetCounts() : ModelCommand("reset-counts") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::EthernetNetworkDiagnostics::Commands::ResetCounts::Type mRequest; -}; - -/* - * Attribute PHYRate - */ -class ReadEthernetNetworkDiagnosticsPHYRate : public ModelCommand -{ -public: - ReadEthernetNetworkDiagnosticsPHYRate() : ModelCommand("read") - { - AddArgument("attr-name", "phyrate"); - ModelCommand::AddArguments(); - } - - ~ReadEthernetNetworkDiagnosticsPHYRate() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::EthernetNetworkDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "EthernetNetworkDiagnostics.PHYRate response", value); - } -}; - -class ReportEthernetNetworkDiagnosticsPHYRate : public ModelCommand -{ -public: - ReportEthernetNetworkDiagnosticsPHYRate() : ModelCommand("subscribe") - { - AddArgument("attr-name", "phyrate"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportEthernetNetworkDiagnosticsPHYRate() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::EthernetNetworkDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("EthernetNetworkDiagnostics.PHYRate report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute FullDuplex - */ -class ReadEthernetNetworkDiagnosticsFullDuplex : public ModelCommand -{ -public: - ReadEthernetNetworkDiagnosticsFullDuplex() : ModelCommand("read") - { - AddArgument("attr-name", "full-duplex"); - ModelCommand::AddArguments(); - } - - ~ReadEthernetNetworkDiagnosticsFullDuplex() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::EthernetNetworkDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, bool value) - { - OnGeneralAttributeEventResponse(context, "EthernetNetworkDiagnostics.FullDuplex response", value); - } -}; - -class ReportEthernetNetworkDiagnosticsFullDuplex : public ModelCommand -{ -public: - ReportEthernetNetworkDiagnosticsFullDuplex() : ModelCommand("subscribe") - { - AddArgument("attr-name", "full-duplex"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportEthernetNetworkDiagnosticsFullDuplex() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::EthernetNetworkDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, bool value) - { - DataModelLogger::LogValue("EthernetNetworkDiagnostics.FullDuplex report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute PacketRxCount - */ -class ReadEthernetNetworkDiagnosticsPacketRxCount : public ModelCommand -{ -public: - ReadEthernetNetworkDiagnosticsPacketRxCount() : ModelCommand("read") - { - AddArgument("attr-name", "packet-rx-count"); - ModelCommand::AddArguments(); - } - - ~ReadEthernetNetworkDiagnosticsPacketRxCount() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::EthernetNetworkDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint64_t value) - { - OnGeneralAttributeEventResponse(context, "EthernetNetworkDiagnostics.PacketRxCount response", value); - } -}; - -class ReportEthernetNetworkDiagnosticsPacketRxCount : public ModelCommand -{ -public: - ReportEthernetNetworkDiagnosticsPacketRxCount() : ModelCommand("subscribe") - { - AddArgument("attr-name", "packet-rx-count"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportEthernetNetworkDiagnosticsPacketRxCount() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::EthernetNetworkDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint64_t value) - { - DataModelLogger::LogValue("EthernetNetworkDiagnostics.PacketRxCount report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute PacketTxCount - */ -class ReadEthernetNetworkDiagnosticsPacketTxCount : public ModelCommand -{ -public: - ReadEthernetNetworkDiagnosticsPacketTxCount() : ModelCommand("read") - { - AddArgument("attr-name", "packet-tx-count"); - ModelCommand::AddArguments(); - } - - ~ReadEthernetNetworkDiagnosticsPacketTxCount() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::EthernetNetworkDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint64_t value) - { - OnGeneralAttributeEventResponse(context, "EthernetNetworkDiagnostics.PacketTxCount response", value); - } -}; - -class ReportEthernetNetworkDiagnosticsPacketTxCount : public ModelCommand -{ -public: - ReportEthernetNetworkDiagnosticsPacketTxCount() : ModelCommand("subscribe") - { - AddArgument("attr-name", "packet-tx-count"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportEthernetNetworkDiagnosticsPacketTxCount() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::EthernetNetworkDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint64_t value) - { - DataModelLogger::LogValue("EthernetNetworkDiagnostics.PacketTxCount report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute TxErrCount - */ -class ReadEthernetNetworkDiagnosticsTxErrCount : public ModelCommand -{ -public: - ReadEthernetNetworkDiagnosticsTxErrCount() : ModelCommand("read") - { - AddArgument("attr-name", "tx-err-count"); - ModelCommand::AddArguments(); - } - - ~ReadEthernetNetworkDiagnosticsTxErrCount() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::EthernetNetworkDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint64_t value) - { - OnGeneralAttributeEventResponse(context, "EthernetNetworkDiagnostics.TxErrCount response", value); - } -}; - -class ReportEthernetNetworkDiagnosticsTxErrCount : public ModelCommand -{ -public: - ReportEthernetNetworkDiagnosticsTxErrCount() : ModelCommand("subscribe") - { - AddArgument("attr-name", "tx-err-count"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportEthernetNetworkDiagnosticsTxErrCount() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::EthernetNetworkDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint64_t value) - { - DataModelLogger::LogValue("EthernetNetworkDiagnostics.TxErrCount report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute CollisionCount - */ -class ReadEthernetNetworkDiagnosticsCollisionCount : public ModelCommand -{ -public: - ReadEthernetNetworkDiagnosticsCollisionCount() : ModelCommand("read") - { - AddArgument("attr-name", "collision-count"); - ModelCommand::AddArguments(); - } - - ~ReadEthernetNetworkDiagnosticsCollisionCount() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::EthernetNetworkDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint64_t value) - { - OnGeneralAttributeEventResponse(context, "EthernetNetworkDiagnostics.CollisionCount response", value); - } -}; - -class ReportEthernetNetworkDiagnosticsCollisionCount : public ModelCommand -{ -public: - ReportEthernetNetworkDiagnosticsCollisionCount() : ModelCommand("subscribe") - { - AddArgument("attr-name", "collision-count"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportEthernetNetworkDiagnosticsCollisionCount() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::EthernetNetworkDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint64_t value) - { - DataModelLogger::LogValue("EthernetNetworkDiagnostics.CollisionCount report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute OverrunCount - */ -class ReadEthernetNetworkDiagnosticsOverrunCount : public ModelCommand -{ -public: - ReadEthernetNetworkDiagnosticsOverrunCount() : ModelCommand("read") - { - AddArgument("attr-name", "overrun-count"); - ModelCommand::AddArguments(); - } - - ~ReadEthernetNetworkDiagnosticsOverrunCount() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::EthernetNetworkDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint64_t value) - { - OnGeneralAttributeEventResponse(context, "EthernetNetworkDiagnostics.OverrunCount response", value); - } -}; - -class ReportEthernetNetworkDiagnosticsOverrunCount : public ModelCommand -{ -public: - ReportEthernetNetworkDiagnosticsOverrunCount() : ModelCommand("subscribe") - { - AddArgument("attr-name", "overrun-count"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportEthernetNetworkDiagnosticsOverrunCount() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::EthernetNetworkDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint64_t value) - { - DataModelLogger::LogValue("EthernetNetworkDiagnostics.OverrunCount report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute CarrierDetect - */ -class ReadEthernetNetworkDiagnosticsCarrierDetect : public ModelCommand -{ -public: - ReadEthernetNetworkDiagnosticsCarrierDetect() : ModelCommand("read") - { - AddArgument("attr-name", "carrier-detect"); - ModelCommand::AddArguments(); - } - - ~ReadEthernetNetworkDiagnosticsCarrierDetect() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000007) on endpoint %" PRIu16, endpointId); - - chip::Controller::EthernetNetworkDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, bool value) - { - OnGeneralAttributeEventResponse(context, "EthernetNetworkDiagnostics.CarrierDetect response", value); - } -}; - -class ReportEthernetNetworkDiagnosticsCarrierDetect : public ModelCommand -{ -public: - ReportEthernetNetworkDiagnosticsCarrierDetect() : ModelCommand("subscribe") - { - AddArgument("attr-name", "carrier-detect"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportEthernetNetworkDiagnosticsCarrierDetect() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000007) on endpoint %" PRIu16, endpointId); - - chip::Controller::EthernetNetworkDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, bool value) - { - DataModelLogger::LogValue("EthernetNetworkDiagnostics.CarrierDetect report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute TimeSinceReset - */ -class ReadEthernetNetworkDiagnosticsTimeSinceReset : public ModelCommand -{ -public: - ReadEthernetNetworkDiagnosticsTimeSinceReset() : ModelCommand("read") - { - AddArgument("attr-name", "time-since-reset"); - ModelCommand::AddArguments(); - } - - ~ReadEthernetNetworkDiagnosticsTimeSinceReset() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x00000008) on endpoint %" PRIu16, endpointId); - - chip::Controller::EthernetNetworkDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint64_t value) - { - OnGeneralAttributeEventResponse(context, "EthernetNetworkDiagnostics.TimeSinceReset response", value); - } -}; - -class ReportEthernetNetworkDiagnosticsTimeSinceReset : public ModelCommand -{ -public: - ReportEthernetNetworkDiagnosticsTimeSinceReset() : ModelCommand("subscribe") - { - AddArgument("attr-name", "time-since-reset"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportEthernetNetworkDiagnosticsTimeSinceReset() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x00000008) on endpoint %" PRIu16, endpointId); - - chip::Controller::EthernetNetworkDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint64_t value) - { - DataModelLogger::LogValue("EthernetNetworkDiagnostics.TimeSinceReset report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadEthernetNetworkDiagnosticsAttributeList : public ModelCommand -{ -public: - ReadEthernetNetworkDiagnosticsAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadEthernetNetworkDiagnosticsAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::EthernetNetworkDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "EthernetNetworkDiagnostics.AttributeList response", value); - } -}; - -class ReportEthernetNetworkDiagnosticsAttributeList : public ModelCommand -{ -public: - ReportEthernetNetworkDiagnosticsAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportEthernetNetworkDiagnosticsAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::EthernetNetworkDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("EthernetNetworkDiagnostics.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute FeatureMap - */ -class ReadEthernetNetworkDiagnosticsFeatureMap : public ModelCommand -{ -public: - ReadEthernetNetworkDiagnosticsFeatureMap() : ModelCommand("read") - { - AddArgument("attr-name", "feature-map"); - ModelCommand::AddArguments(); - } - - ~ReadEthernetNetworkDiagnosticsFeatureMap() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x0000FFFC) on endpoint %" PRIu16, endpointId); - - chip::Controller::EthernetNetworkDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint32_t value) - { - OnGeneralAttributeEventResponse(context, "EthernetNetworkDiagnostics.FeatureMap response", value); - } -}; - -class ReportEthernetNetworkDiagnosticsFeatureMap : public ModelCommand -{ -public: - ReportEthernetNetworkDiagnosticsFeatureMap() : ModelCommand("subscribe") - { - AddArgument("attr-name", "feature-map"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportEthernetNetworkDiagnosticsFeatureMap() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x0000FFFC) on endpoint %" PRIu16, endpointId); - - chip::Controller::EthernetNetworkDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint32_t value) - { - DataModelLogger::LogValue("EthernetNetworkDiagnostics.FeatureMap report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadEthernetNetworkDiagnosticsClusterRevision : public ModelCommand -{ -public: - ReadEthernetNetworkDiagnosticsClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadEthernetNetworkDiagnosticsClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::EthernetNetworkDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "EthernetNetworkDiagnostics.ClusterRevision response", value); - } -}; - -class ReportEthernetNetworkDiagnosticsClusterRevision : public ModelCommand -{ -public: - ReportEthernetNetworkDiagnosticsClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportEthernetNetworkDiagnosticsClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000037) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::EthernetNetworkDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("EthernetNetworkDiagnostics.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster FixedLabel | 0x0040 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * LabelList | 0x0000 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Attribute LabelList - */ -class ReadFixedLabelLabelList : public ModelCommand -{ -public: - ReadFixedLabelLabelList() : ModelCommand("read") - { - AddArgument("attr-name", "label-list"); - ModelCommand::AddArguments(); - } - - ~ReadFixedLabelLabelList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::FixedLabelCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse( - void * context, - const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "FixedLabel.LabelList response", value); - } -}; - -class ReportFixedLabelLabelList : public ModelCommand -{ -public: - ReportFixedLabelLabelList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "label-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportFixedLabelLabelList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::FixedLabelCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport( - void * context, - const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("FixedLabel.LabelList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadFixedLabelAttributeList : public ModelCommand -{ -public: - ReadFixedLabelAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadFixedLabelAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::FixedLabelCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "FixedLabel.AttributeList response", value); - } -}; - -class ReportFixedLabelAttributeList : public ModelCommand -{ -public: - ReportFixedLabelAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportFixedLabelAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::FixedLabelCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("FixedLabel.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadFixedLabelClusterRevision : public ModelCommand -{ -public: - ReadFixedLabelClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadFixedLabelClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::FixedLabelCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "FixedLabel.ClusterRevision response", value); - } -}; - -class ReportFixedLabelClusterRevision : public ModelCommand -{ -public: - ReportFixedLabelClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportFixedLabelClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000040) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::FixedLabelCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("FixedLabel.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster FlowMeasurement | 0x0404 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * MeasuredValue | 0x0000 | -| * MinMeasuredValue | 0x0001 | -| * MaxMeasuredValue | 0x0002 | -| * Tolerance | 0x0003 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Attribute MeasuredValue - */ -class ReadFlowMeasurementMeasuredValue : public ModelCommand -{ -public: - ReadFlowMeasurementMeasuredValue() : ModelCommand("read") - { - AddArgument("attr-name", "measured-value"); - ModelCommand::AddArguments(); - } - - ~ReadFlowMeasurementMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::FlowMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "FlowMeasurement.MeasuredValue response", value); - } -}; - -class ReportFlowMeasurementMeasuredValue : public ModelCommand -{ -public: - ReportFlowMeasurementMeasuredValue() : ModelCommand("subscribe") - { - AddArgument("attr-name", "measured-value"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportFlowMeasurementMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::FlowMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("FlowMeasurement.MeasuredValue report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MinMeasuredValue - */ -class ReadFlowMeasurementMinMeasuredValue : public ModelCommand -{ -public: - ReadFlowMeasurementMinMeasuredValue() : ModelCommand("read") - { - AddArgument("attr-name", "min-measured-value"); - ModelCommand::AddArguments(); - } - - ~ReadFlowMeasurementMinMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::FlowMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "FlowMeasurement.MinMeasuredValue response", value); - } -}; - -class ReportFlowMeasurementMinMeasuredValue : public ModelCommand -{ -public: - ReportFlowMeasurementMinMeasuredValue() : ModelCommand("subscribe") - { - AddArgument("attr-name", "min-measured-value"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportFlowMeasurementMinMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::FlowMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("FlowMeasurement.MinMeasuredValue report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MaxMeasuredValue - */ -class ReadFlowMeasurementMaxMeasuredValue : public ModelCommand -{ -public: - ReadFlowMeasurementMaxMeasuredValue() : ModelCommand("read") - { - AddArgument("attr-name", "max-measured-value"); - ModelCommand::AddArguments(); - } - - ~ReadFlowMeasurementMaxMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::FlowMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "FlowMeasurement.MaxMeasuredValue response", value); - } -}; - -class ReportFlowMeasurementMaxMeasuredValue : public ModelCommand -{ -public: - ReportFlowMeasurementMaxMeasuredValue() : ModelCommand("subscribe") - { - AddArgument("attr-name", "max-measured-value"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportFlowMeasurementMaxMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::FlowMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("FlowMeasurement.MaxMeasuredValue report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Tolerance - */ -class ReadFlowMeasurementTolerance : public ModelCommand -{ -public: - ReadFlowMeasurementTolerance() : ModelCommand("read") - { - AddArgument("attr-name", "tolerance"); - ModelCommand::AddArguments(); - } - - ~ReadFlowMeasurementTolerance() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::FlowMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "FlowMeasurement.Tolerance response", value); - } -}; - -class ReportFlowMeasurementTolerance : public ModelCommand -{ -public: - ReportFlowMeasurementTolerance() : ModelCommand("subscribe") - { - AddArgument("attr-name", "tolerance"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportFlowMeasurementTolerance() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::FlowMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("FlowMeasurement.Tolerance report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadFlowMeasurementAttributeList : public ModelCommand -{ -public: - ReadFlowMeasurementAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadFlowMeasurementAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::FlowMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "FlowMeasurement.AttributeList response", value); - } -}; - -class ReportFlowMeasurementAttributeList : public ModelCommand -{ -public: - ReportFlowMeasurementAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportFlowMeasurementAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::FlowMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("FlowMeasurement.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadFlowMeasurementClusterRevision : public ModelCommand -{ -public: - ReadFlowMeasurementClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadFlowMeasurementClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::FlowMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "FlowMeasurement.ClusterRevision response", value); - } -}; - -class ReportFlowMeasurementClusterRevision : public ModelCommand -{ -public: - ReportFlowMeasurementClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportFlowMeasurementClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000404) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::FlowMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("FlowMeasurement.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster GeneralCommissioning | 0x0030 | -|------------------------------------------------------------------------------| -| Commands: | | -| * ArmFailSafe | 0x00 | -| * CommissioningComplete | 0x04 | -| * SetRegulatoryConfig | 0x02 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * Breadcrumb | 0x0000 | -| * BasicCommissioningInfoList | 0x0001 | -| * RegulatoryConfig | 0x0002 | -| * LocationCapability | 0x0003 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command ArmFailSafe - */ -class GeneralCommissioningArmFailSafe : public ModelCommand -{ -public: - GeneralCommissioningArmFailSafe() : ModelCommand("arm-fail-safe") - { - AddArgument("ExpiryLengthSeconds", 0, UINT16_MAX, &mRequest.expiryLengthSeconds); - AddArgument("Breadcrumb", 0, UINT64_MAX, &mRequest.breadcrumb); - AddArgument("TimeoutMs", 0, UINT32_MAX, &mRequest.timeoutMs); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnGeneralCommissioningArmFailSafeResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafe::Type mRequest; -}; - -/* - * Command CommissioningComplete - */ -class GeneralCommissioningCommissioningComplete : public ModelCommand -{ -public: - GeneralCommissioningCommissioningComplete() : ModelCommand("commissioning-complete") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) command (0x00000004) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnGeneralCommissioningCommissioningCompleteResponseSuccess, - OnDefaultFailure, endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::GeneralCommissioning::Commands::CommissioningComplete::Type mRequest; -}; - -/* - * Command SetRegulatoryConfig - */ -class GeneralCommissioningSetRegulatoryConfig : public ModelCommand -{ -public: - GeneralCommissioningSetRegulatoryConfig() : ModelCommand("set-regulatory-config") - { - AddArgument("Location", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.location)); - AddArgument("CountryCode", &mRequest.countryCode); - AddArgument("Breadcrumb", 0, UINT64_MAX, &mRequest.breadcrumb); - AddArgument("TimeoutMs", 0, UINT32_MAX, &mRequest.timeoutMs); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) command (0x00000002) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnGeneralCommissioningSetRegulatoryConfigResponseSuccess, - OnDefaultFailure, endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfig::Type mRequest; -}; - -/* - * Attribute Breadcrumb - */ -class ReadGeneralCommissioningBreadcrumb : public ModelCommand -{ -public: - ReadGeneralCommissioningBreadcrumb() : ModelCommand("read") - { - AddArgument("attr-name", "breadcrumb"); - ModelCommand::AddArguments(); - } - - ~ReadGeneralCommissioningBreadcrumb() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralCommissioningCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint64_t value) - { - OnGeneralAttributeEventResponse(context, "GeneralCommissioning.Breadcrumb response", value); - } -}; - -class WriteGeneralCommissioningBreadcrumb : public ModelCommand -{ -public: - WriteGeneralCommissioningBreadcrumb() : ModelCommand("write") - { - AddArgument("attr-name", "breadcrumb"); - AddArgument("attr-value", 0, UINT64_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteGeneralCommissioningBreadcrumb() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) WriteAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralCommissioningCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint64_t mValue; -}; - -class ReportGeneralCommissioningBreadcrumb : public ModelCommand -{ -public: - ReportGeneralCommissioningBreadcrumb() : ModelCommand("subscribe") - { - AddArgument("attr-name", "breadcrumb"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGeneralCommissioningBreadcrumb() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralCommissioningCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint64_t value) - { - DataModelLogger::LogValue("GeneralCommissioning.Breadcrumb report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute BasicCommissioningInfoList - */ -class ReadGeneralCommissioningBasicCommissioningInfoList : public ModelCommand -{ -public: - ReadGeneralCommissioningBasicCommissioningInfoList() : ModelCommand("read") - { - AddArgument("attr-name", "basic-commissioning-info-list"); - ModelCommand::AddArguments(); - } - - ~ReadGeneralCommissioningBasicCommissioningInfoList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralCommissioningCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void - OnAttributeResponse(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::GeneralCommissioning::Structs::BasicCommissioningInfoType::DecodableType> & value) - { - OnGeneralAttributeEventResponse(context, "GeneralCommissioning.BasicCommissioningInfoList response", value); - } -}; - -class ReportGeneralCommissioningBasicCommissioningInfoList : public ModelCommand -{ -public: - ReportGeneralCommissioningBasicCommissioningInfoList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "basic-commissioning-info-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGeneralCommissioningBasicCommissioningInfoList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralCommissioningCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster - .SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void - OnValueReport(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::GeneralCommissioning::Structs::BasicCommissioningInfoType::DecodableType> & value) - { - DataModelLogger::LogValue("GeneralCommissioning.BasicCommissioningInfoList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute RegulatoryConfig - */ -class ReadGeneralCommissioningRegulatoryConfig : public ModelCommand -{ -public: - ReadGeneralCommissioningRegulatoryConfig() : ModelCommand("read") - { - AddArgument("attr-name", "regulatory-config"); - ModelCommand::AddArguments(); - } - - ~ReadGeneralCommissioningRegulatoryConfig() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralCommissioningCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "GeneralCommissioning.RegulatoryConfig response", value); - } -}; - -class ReportGeneralCommissioningRegulatoryConfig : public ModelCommand -{ -public: - ReportGeneralCommissioningRegulatoryConfig() : ModelCommand("subscribe") - { - AddArgument("attr-name", "regulatory-config"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGeneralCommissioningRegulatoryConfig() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralCommissioningCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("GeneralCommissioning.RegulatoryConfig report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute LocationCapability - */ -class ReadGeneralCommissioningLocationCapability : public ModelCommand -{ -public: - ReadGeneralCommissioningLocationCapability() : ModelCommand("read") - { - AddArgument("attr-name", "location-capability"); - ModelCommand::AddArguments(); - } - - ~ReadGeneralCommissioningLocationCapability() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralCommissioningCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "GeneralCommissioning.LocationCapability response", value); - } -}; - -class ReportGeneralCommissioningLocationCapability : public ModelCommand -{ -public: - ReportGeneralCommissioningLocationCapability() : ModelCommand("subscribe") - { - AddArgument("attr-name", "location-capability"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGeneralCommissioningLocationCapability() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralCommissioningCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("GeneralCommissioning.LocationCapability report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadGeneralCommissioningAttributeList : public ModelCommand -{ -public: - ReadGeneralCommissioningAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadGeneralCommissioningAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralCommissioningCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "GeneralCommissioning.AttributeList response", value); - } -}; - -class ReportGeneralCommissioningAttributeList : public ModelCommand -{ -public: - ReportGeneralCommissioningAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGeneralCommissioningAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralCommissioningCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("GeneralCommissioning.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadGeneralCommissioningClusterRevision : public ModelCommand -{ -public: - ReadGeneralCommissioningClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadGeneralCommissioningClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralCommissioningCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "GeneralCommissioning.ClusterRevision response", value); - } -}; - -class ReportGeneralCommissioningClusterRevision : public ModelCommand -{ -public: - ReportGeneralCommissioningClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGeneralCommissioningClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000030) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralCommissioningCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("GeneralCommissioning.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster GeneralDiagnostics | 0x0033 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * NetworkInterfaces | 0x0000 | -| * RebootCount | 0x0001 | -| * UpTime | 0x0002 | -| * TotalOperationalHours | 0x0003 | -| * BootReasons | 0x0004 | -| * ActiveHardwareFaults | 0x0005 | -| * ActiveRadioFaults | 0x0006 | -| * ActiveNetworkFaults | 0x0007 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -| * HardwareFaultChange | 0x0000 | -| * RadioFaultChange | 0x0001 | -| * NetworkFaultChange | 0x0002 | -| * BootReason | 0x0003 | -\*----------------------------------------------------------------------------*/ - -/* - * Event HardwareFaultChange - */ -class ReadGeneralDiagnosticsHardwareFaultChange : public ModelCommand -{ -public: - ReadGeneralDiagnosticsHardwareFaultChange() : ModelCommand("read-event") - { - AddArgument("event-name", "hardware-fault-change"); - ModelCommand::AddArguments(); - } - - ~ReadGeneralDiagnosticsHardwareFaultChange() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadEvent (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void OnEventResponse(void * context, - chip::app::Clusters::GeneralDiagnostics::Events::HardwareFaultChange::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "GeneralDiagnostics.HardwareFaultChange response", value); - } -}; - -class ReportGeneralDiagnosticsHardwareFaultChange : public ModelCommand -{ -public: - ReportGeneralDiagnosticsHardwareFaultChange() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "hardware-fault-change"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGeneralDiagnosticsHardwareFaultChange() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportEvent (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - chip::app::Clusters::GeneralDiagnostics::Events::HardwareFaultChange::DecodableType value) - { - DataModelLogger::LogValue("GeneralDiagnostics.HardwareFaultChange report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event RadioFaultChange - */ -class ReadGeneralDiagnosticsRadioFaultChange : public ModelCommand -{ -public: - ReadGeneralDiagnosticsRadioFaultChange() : ModelCommand("read-event") - { - AddArgument("event-name", "radio-fault-change"); - ModelCommand::AddArguments(); - } - - ~ReadGeneralDiagnosticsRadioFaultChange() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadEvent (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void OnEventResponse(void * context, - chip::app::Clusters::GeneralDiagnostics::Events::RadioFaultChange::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "GeneralDiagnostics.RadioFaultChange response", value); - } -}; - -class ReportGeneralDiagnosticsRadioFaultChange : public ModelCommand -{ -public: - ReportGeneralDiagnosticsRadioFaultChange() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "radio-fault-change"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGeneralDiagnosticsRadioFaultChange() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportEvent (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - chip::app::Clusters::GeneralDiagnostics::Events::RadioFaultChange::DecodableType value) - { - DataModelLogger::LogValue("GeneralDiagnostics.RadioFaultChange report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event NetworkFaultChange - */ -class ReadGeneralDiagnosticsNetworkFaultChange : public ModelCommand -{ -public: - ReadGeneralDiagnosticsNetworkFaultChange() : ModelCommand("read-event") - { - AddArgument("event-name", "network-fault-change"); - ModelCommand::AddArguments(); - } - - ~ReadGeneralDiagnosticsNetworkFaultChange() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadEvent (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void OnEventResponse(void * context, - chip::app::Clusters::GeneralDiagnostics::Events::NetworkFaultChange::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "GeneralDiagnostics.NetworkFaultChange response", value); - } -}; - -class ReportGeneralDiagnosticsNetworkFaultChange : public ModelCommand -{ -public: - ReportGeneralDiagnosticsNetworkFaultChange() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "network-fault-change"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGeneralDiagnosticsNetworkFaultChange() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportEvent (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - chip::app::Clusters::GeneralDiagnostics::Events::NetworkFaultChange::DecodableType value) - { - DataModelLogger::LogValue("GeneralDiagnostics.NetworkFaultChange report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event BootReason - */ -class ReadGeneralDiagnosticsBootReason : public ModelCommand -{ -public: - ReadGeneralDiagnosticsBootReason() : ModelCommand("read-event") - { - AddArgument("event-name", "boot-reason"); - ModelCommand::AddArguments(); - } - - ~ReadGeneralDiagnosticsBootReason() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadEvent (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent(this, OnEventResponse, - OnDefaultFailure); - } - - static void OnEventResponse(void * context, chip::app::Clusters::GeneralDiagnostics::Events::BootReason::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "GeneralDiagnostics.BootReason response", value); - } -}; - -class ReportGeneralDiagnosticsBootReason : public ModelCommand -{ -public: - ReportGeneralDiagnosticsBootReason() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "boot-reason"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGeneralDiagnosticsBootReason() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportEvent (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::GeneralDiagnostics::Events::BootReason::DecodableType value) - { - DataModelLogger::LogValue("GeneralDiagnostics.BootReason report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NetworkInterfaces - */ -class ReadGeneralDiagnosticsNetworkInterfaces : public ModelCommand -{ -public: - ReadGeneralDiagnosticsNetworkInterfaces() : ModelCommand("read") - { - AddArgument("attr-name", "network-interfaces"); - ModelCommand::AddArguments(); - } - - ~ReadGeneralDiagnosticsNetworkInterfaces() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void - OnAttributeResponse(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::GeneralDiagnostics::Structs::NetworkInterfaceType::DecodableType> & value) - { - OnGeneralAttributeEventResponse(context, "GeneralDiagnostics.NetworkInterfaces response", value); - } -}; - -class ReportGeneralDiagnosticsNetworkInterfaces : public ModelCommand -{ -public: - ReportGeneralDiagnosticsNetworkInterfaces() : ModelCommand("subscribe") - { - AddArgument("attr-name", "network-interfaces"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGeneralDiagnosticsNetworkInterfaces() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::GeneralDiagnostics::Structs::NetworkInterfaceType::DecodableType> & value) - { - DataModelLogger::LogValue("GeneralDiagnostics.NetworkInterfaces report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute RebootCount - */ -class ReadGeneralDiagnosticsRebootCount : public ModelCommand -{ -public: - ReadGeneralDiagnosticsRebootCount() : ModelCommand("read") - { - AddArgument("attr-name", "reboot-count"); - ModelCommand::AddArguments(); - } - - ~ReadGeneralDiagnosticsRebootCount() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "GeneralDiagnostics.RebootCount response", value); - } -}; - -class ReportGeneralDiagnosticsRebootCount : public ModelCommand -{ -public: - ReportGeneralDiagnosticsRebootCount() : ModelCommand("subscribe") - { - AddArgument("attr-name", "reboot-count"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGeneralDiagnosticsRebootCount() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("GeneralDiagnostics.RebootCount report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute UpTime - */ -class ReadGeneralDiagnosticsUpTime : public ModelCommand -{ -public: - ReadGeneralDiagnosticsUpTime() : ModelCommand("read") - { - AddArgument("attr-name", "up-time"); - ModelCommand::AddArguments(); - } - - ~ReadGeneralDiagnosticsUpTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint64_t value) - { - OnGeneralAttributeEventResponse(context, "GeneralDiagnostics.UpTime response", value); - } -}; - -class ReportGeneralDiagnosticsUpTime : public ModelCommand -{ -public: - ReportGeneralDiagnosticsUpTime() : ModelCommand("subscribe") - { - AddArgument("attr-name", "up-time"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGeneralDiagnosticsUpTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint64_t value) - { - DataModelLogger::LogValue("GeneralDiagnostics.UpTime report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute TotalOperationalHours - */ -class ReadGeneralDiagnosticsTotalOperationalHours : public ModelCommand -{ -public: - ReadGeneralDiagnosticsTotalOperationalHours() : ModelCommand("read") - { - AddArgument("attr-name", "total-operational-hours"); - ModelCommand::AddArguments(); - } - - ~ReadGeneralDiagnosticsTotalOperationalHours() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint32_t value) - { - OnGeneralAttributeEventResponse(context, "GeneralDiagnostics.TotalOperationalHours response", value); - } -}; - -class ReportGeneralDiagnosticsTotalOperationalHours : public ModelCommand -{ -public: - ReportGeneralDiagnosticsTotalOperationalHours() : ModelCommand("subscribe") - { - AddArgument("attr-name", "total-operational-hours"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGeneralDiagnosticsTotalOperationalHours() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint32_t value) - { - DataModelLogger::LogValue("GeneralDiagnostics.TotalOperationalHours report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute BootReasons - */ -class ReadGeneralDiagnosticsBootReasons : public ModelCommand -{ -public: - ReadGeneralDiagnosticsBootReasons() : ModelCommand("read") - { - AddArgument("attr-name", "boot-reasons"); - ModelCommand::AddArguments(); - } - - ~ReadGeneralDiagnosticsBootReasons() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "GeneralDiagnostics.BootReasons response", value); - } -}; - -class ReportGeneralDiagnosticsBootReasons : public ModelCommand -{ -public: - ReportGeneralDiagnosticsBootReasons() : ModelCommand("subscribe") - { - AddArgument("attr-name", "boot-reasons"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGeneralDiagnosticsBootReasons() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("GeneralDiagnostics.BootReasons report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ActiveHardwareFaults - */ -class ReadGeneralDiagnosticsActiveHardwareFaults : public ModelCommand -{ -public: - ReadGeneralDiagnosticsActiveHardwareFaults() : ModelCommand("read") - { - AddArgument("attr-name", "active-hardware-faults"); - ModelCommand::AddArguments(); - } - - ~ReadGeneralDiagnosticsActiveHardwareFaults() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "GeneralDiagnostics.ActiveHardwareFaults response", value); - } -}; - -class ReportGeneralDiagnosticsActiveHardwareFaults : public ModelCommand -{ -public: - ReportGeneralDiagnosticsActiveHardwareFaults() : ModelCommand("subscribe") - { - AddArgument("attr-name", "active-hardware-faults"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGeneralDiagnosticsActiveHardwareFaults() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("GeneralDiagnostics.ActiveHardwareFaults report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ActiveRadioFaults - */ -class ReadGeneralDiagnosticsActiveRadioFaults : public ModelCommand -{ -public: - ReadGeneralDiagnosticsActiveRadioFaults() : ModelCommand("read") - { - AddArgument("attr-name", "active-radio-faults"); - ModelCommand::AddArguments(); - } - - ~ReadGeneralDiagnosticsActiveRadioFaults() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "GeneralDiagnostics.ActiveRadioFaults response", value); - } -}; - -class ReportGeneralDiagnosticsActiveRadioFaults : public ModelCommand -{ -public: - ReportGeneralDiagnosticsActiveRadioFaults() : ModelCommand("subscribe") - { - AddArgument("attr-name", "active-radio-faults"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGeneralDiagnosticsActiveRadioFaults() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("GeneralDiagnostics.ActiveRadioFaults report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ActiveNetworkFaults - */ -class ReadGeneralDiagnosticsActiveNetworkFaults : public ModelCommand -{ -public: - ReadGeneralDiagnosticsActiveNetworkFaults() : ModelCommand("read") - { - AddArgument("attr-name", "active-network-faults"); - ModelCommand::AddArguments(); - } - - ~ReadGeneralDiagnosticsActiveNetworkFaults() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x00000007) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "GeneralDiagnostics.ActiveNetworkFaults response", value); - } -}; - -class ReportGeneralDiagnosticsActiveNetworkFaults : public ModelCommand -{ -public: - ReportGeneralDiagnosticsActiveNetworkFaults() : ModelCommand("subscribe") - { - AddArgument("attr-name", "active-network-faults"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGeneralDiagnosticsActiveNetworkFaults() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x00000007) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("GeneralDiagnostics.ActiveNetworkFaults report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadGeneralDiagnosticsAttributeList : public ModelCommand -{ -public: - ReadGeneralDiagnosticsAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadGeneralDiagnosticsAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "GeneralDiagnostics.AttributeList response", value); - } -}; - -class ReportGeneralDiagnosticsAttributeList : public ModelCommand -{ -public: - ReportGeneralDiagnosticsAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGeneralDiagnosticsAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("GeneralDiagnostics.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadGeneralDiagnosticsClusterRevision : public ModelCommand -{ -public: - ReadGeneralDiagnosticsClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadGeneralDiagnosticsClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "GeneralDiagnostics.ClusterRevision response", value); - } -}; - -class ReportGeneralDiagnosticsClusterRevision : public ModelCommand -{ -public: - ReportGeneralDiagnosticsClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGeneralDiagnosticsClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000033) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::GeneralDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("GeneralDiagnostics.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster GroupKeyManagement | 0x003F | -|------------------------------------------------------------------------------| -| Commands: | | -| * KeySetRead | 0x01 | -| * KeySetReadAllIndices | 0x04 | -| * KeySetRemove | 0x03 | -| * KeySetWrite | 0x00 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * GroupKeyMap | 0x0000 | -| * GroupTable | 0x0001 | -| * MaxGroupsPerFabric | 0x0002 | -| * MaxGroupKeysPerFabric | 0x0003 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command KeySetRead - */ -class GroupKeyManagementKeySetRead : public ModelCommand -{ -public: - GroupKeyManagementKeySetRead() : ModelCommand("key-set-read") - { - AddArgument("GroupKeySetID", 0, UINT16_MAX, &mRequest.groupKeySetID); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) command (0x00000001) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnGroupKeyManagementKeySetReadResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type mRequest; -}; - -/* - * Command KeySetReadAllIndices - */ -class GroupKeyManagementKeySetReadAllIndices : public ModelCommand -{ -public: - GroupKeyManagementKeySetReadAllIndices() : - ModelCommand("key-set-read-all-indices"), mComplex_GroupKeySetIDs(&mRequest.groupKeySetIDs) - { - // GroupKeySetIDs Array parsing is not supported yet - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) command (0x00000004) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnGroupKeyManagementKeySetReadAllIndicesResponseSuccess, - OnDefaultFailure, endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndices::Type mRequest; - TypedComplexArgument> mComplex_GroupKeySetIDs; -}; - -/* - * Command KeySetRemove - */ -class GroupKeyManagementKeySetRemove : public ModelCommand -{ -public: - GroupKeyManagementKeySetRemove() : ModelCommand("key-set-remove") - { - AddArgument("GroupKeySetID", 0, UINT16_MAX, &mRequest.groupKeySetID); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) command (0x00000003) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Type mRequest; -}; - -/* - * Command KeySetWrite - */ -class GroupKeyManagementKeySetWrite : public ModelCommand -{ -public: - GroupKeyManagementKeySetWrite() : ModelCommand("key-set-write"), mComplex_GroupKeySet(&mRequest.groupKeySet) - { - // GroupKeySet Struct parsing is not supported yet - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type mRequest; - TypedComplexArgument mComplex_GroupKeySet; -}; - -/* - * Attribute GroupKeyMap - */ -class ReadGroupKeyManagementGroupKeyMap : public ModelCommand -{ -public: - ReadGroupKeyManagementGroupKeyMap() : ModelCommand("read") - { - AddArgument("attr-name", "group-key-map"); - ModelCommand::AddArguments(); - } - - ~ReadGroupKeyManagementGroupKeyMap() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::GroupKeyManagementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::DecodableType> & value) - { - OnGeneralAttributeEventResponse(context, "GroupKeyManagement.GroupKeyMap response", value); - } -}; - -class ReportGroupKeyManagementGroupKeyMap : public ModelCommand -{ -public: - ReportGroupKeyManagementGroupKeyMap() : ModelCommand("subscribe") - { - AddArgument("attr-name", "group-key-map"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGroupKeyManagementGroupKeyMap() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::GroupKeyManagementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::DecodableType> & value) - { - DataModelLogger::LogValue("GroupKeyManagement.GroupKeyMap report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute GroupTable - */ -class ReadGroupKeyManagementGroupTable : public ModelCommand -{ -public: - ReadGroupKeyManagementGroupTable() : ModelCommand("read") - { - AddArgument("attr-name", "group-table"); - ModelCommand::AddArguments(); - } - - ~ReadGroupKeyManagementGroupTable() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::GroupKeyManagementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void - OnAttributeResponse(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::GroupKeyManagement::Structs::GroupInfoMapStruct::DecodableType> & value) - { - OnGeneralAttributeEventResponse(context, "GroupKeyManagement.GroupTable response", value); - } -}; - -class ReportGroupKeyManagementGroupTable : public ModelCommand -{ -public: - ReportGroupKeyManagementGroupTable() : ModelCommand("subscribe") - { - AddArgument("attr-name", "group-table"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGroupKeyManagementGroupTable() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::GroupKeyManagementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::GroupKeyManagement::Structs::GroupInfoMapStruct::DecodableType> & value) - { - DataModelLogger::LogValue("GroupKeyManagement.GroupTable report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MaxGroupsPerFabric - */ -class ReadGroupKeyManagementMaxGroupsPerFabric : public ModelCommand -{ -public: - ReadGroupKeyManagementMaxGroupsPerFabric() : ModelCommand("read") - { - AddArgument("attr-name", "max-groups-per-fabric"); - ModelCommand::AddArguments(); - } - - ~ReadGroupKeyManagementMaxGroupsPerFabric() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::GroupKeyManagementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "GroupKeyManagement.MaxGroupsPerFabric response", value); - } -}; - -class ReportGroupKeyManagementMaxGroupsPerFabric : public ModelCommand -{ -public: - ReportGroupKeyManagementMaxGroupsPerFabric() : ModelCommand("subscribe") - { - AddArgument("attr-name", "max-groups-per-fabric"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGroupKeyManagementMaxGroupsPerFabric() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::GroupKeyManagementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("GroupKeyManagement.MaxGroupsPerFabric report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MaxGroupKeysPerFabric - */ -class ReadGroupKeyManagementMaxGroupKeysPerFabric : public ModelCommand -{ -public: - ReadGroupKeyManagementMaxGroupKeysPerFabric() : ModelCommand("read") - { - AddArgument("attr-name", "max-group-keys-per-fabric"); - ModelCommand::AddArguments(); - } - - ~ReadGroupKeyManagementMaxGroupKeysPerFabric() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::GroupKeyManagementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "GroupKeyManagement.MaxGroupKeysPerFabric response", value); - } -}; - -class ReportGroupKeyManagementMaxGroupKeysPerFabric : public ModelCommand -{ -public: - ReportGroupKeyManagementMaxGroupKeysPerFabric() : ModelCommand("subscribe") - { - AddArgument("attr-name", "max-group-keys-per-fabric"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGroupKeyManagementMaxGroupKeysPerFabric() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::GroupKeyManagementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("GroupKeyManagement.MaxGroupKeysPerFabric report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadGroupKeyManagementAttributeList : public ModelCommand -{ -public: - ReadGroupKeyManagementAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadGroupKeyManagementAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::GroupKeyManagementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "GroupKeyManagement.AttributeList response", value); - } -}; - -class ReportGroupKeyManagementAttributeList : public ModelCommand -{ -public: - ReportGroupKeyManagementAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGroupKeyManagementAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::GroupKeyManagementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("GroupKeyManagement.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadGroupKeyManagementClusterRevision : public ModelCommand -{ -public: - ReadGroupKeyManagementClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadGroupKeyManagementClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::GroupKeyManagementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "GroupKeyManagement.ClusterRevision response", value); - } -}; - -class ReportGroupKeyManagementClusterRevision : public ModelCommand -{ -public: - ReportGroupKeyManagementClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGroupKeyManagementClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003F) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::GroupKeyManagementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("GroupKeyManagement.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster Groups | 0x0004 | -|------------------------------------------------------------------------------| -| Commands: | | -| * AddGroup | 0x00 | -| * AddGroupIfIdentifying | 0x05 | -| * GetGroupMembership | 0x02 | -| * RemoveAllGroups | 0x04 | -| * RemoveGroup | 0x03 | -| * ViewGroup | 0x01 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * NameSupport | 0x0000 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command AddGroup - */ -class GroupsAddGroup : public ModelCommand -{ -public: - GroupsAddGroup() : ModelCommand("add-group") - { - AddArgument("GroupId", 0, UINT16_MAX, &mRequest.groupId); - AddArgument("GroupName", &mRequest.groupName); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnGroupsAddGroupResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Groups::Commands::AddGroup::Type mRequest; -}; - -/* - * Command AddGroupIfIdentifying - */ -class GroupsAddGroupIfIdentifying : public ModelCommand -{ -public: - GroupsAddGroupIfIdentifying() : ModelCommand("add-group-if-identifying") - { - AddArgument("GroupId", 0, UINT16_MAX, &mRequest.groupId); - AddArgument("GroupName", &mRequest.groupName); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) command (0x00000005) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Groups::Commands::AddGroupIfIdentifying::Type mRequest; -}; - -/* - * Command GetGroupMembership - */ -class GroupsGetGroupMembership : public ModelCommand -{ -public: - GroupsGetGroupMembership() : ModelCommand("get-group-membership"), mComplex_GroupList(&mRequest.groupList) - { - AddArgument("GroupList", &mComplex_GroupList); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) command (0x00000002) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnGroupsGetGroupMembershipResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Groups::Commands::GetGroupMembership::Type mRequest; - TypedComplexArgument> mComplex_GroupList; -}; - -/* - * Command RemoveAllGroups - */ -class GroupsRemoveAllGroups : public ModelCommand -{ -public: - GroupsRemoveAllGroups() : ModelCommand("remove-all-groups") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) command (0x00000004) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Groups::Commands::RemoveAllGroups::Type mRequest; -}; - -/* - * Command RemoveGroup - */ -class GroupsRemoveGroup : public ModelCommand -{ -public: - GroupsRemoveGroup() : ModelCommand("remove-group") - { - AddArgument("GroupId", 0, UINT16_MAX, &mRequest.groupId); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) command (0x00000003) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnGroupsRemoveGroupResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Groups::Commands::RemoveGroup::Type mRequest; -}; - -/* - * Command ViewGroup - */ -class GroupsViewGroup : public ModelCommand -{ -public: - GroupsViewGroup() : ModelCommand("view-group") - { - AddArgument("GroupId", 0, UINT16_MAX, &mRequest.groupId); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) command (0x00000001) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnGroupsViewGroupResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Groups::Commands::ViewGroup::Type mRequest; -}; - -/* - * Attribute NameSupport - */ -class ReadGroupsNameSupport : public ModelCommand -{ -public: - ReadGroupsNameSupport() : ModelCommand("read") - { - AddArgument("attr-name", "name-support"); - ModelCommand::AddArguments(); - } - - ~ReadGroupsNameSupport() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::GroupsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "Groups.NameSupport response", value); - } -}; - -class ReportGroupsNameSupport : public ModelCommand -{ -public: - ReportGroupsNameSupport() : ModelCommand("subscribe") - { - AddArgument("attr-name", "name-support"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGroupsNameSupport() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::GroupsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) { DataModelLogger::LogValue("Groups.NameSupport report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadGroupsAttributeList : public ModelCommand -{ -public: - ReadGroupsAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadGroupsAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::GroupsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "Groups.AttributeList response", value); - } -}; - -class ReportGroupsAttributeList : public ModelCommand -{ -public: - ReportGroupsAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGroupsAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::GroupsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("Groups.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadGroupsClusterRevision : public ModelCommand -{ -public: - ReadGroupsClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadGroupsClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::GroupsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "Groups.ClusterRevision response", value); - } -}; - -class ReportGroupsClusterRevision : public ModelCommand -{ -public: - ReportGroupsClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportGroupsClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000004) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::GroupsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("Groups.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster Identify | 0x0003 | -|------------------------------------------------------------------------------| -| Commands: | | -| * Identify | 0x00 | -| * IdentifyQuery | 0x01 | -| * TriggerEffect | 0x40 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * IdentifyTime | 0x0000 | -| * IdentifyType | 0x0001 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command Identify - */ -class IdentifyIdentify : public ModelCommand -{ -public: - IdentifyIdentify() : ModelCommand("identify") - { - AddArgument("IdentifyTime", 0, UINT16_MAX, &mRequest.identifyTime); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Identify::Commands::Identify::Type mRequest; -}; - -/* - * Command IdentifyQuery - */ -class IdentifyIdentifyQuery : public ModelCommand -{ -public: - IdentifyIdentifyQuery() : ModelCommand("identify-query") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) command (0x00000001) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnIdentifyIdentifyQueryResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Identify::Commands::IdentifyQuery::Type mRequest; -}; - -/* - * Command TriggerEffect - */ -class IdentifyTriggerEffect : public ModelCommand -{ -public: - IdentifyTriggerEffect() : ModelCommand("trigger-effect") - { - AddArgument("EffectIdentifier", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.effectIdentifier)); - AddArgument("EffectVariant", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.effectVariant)); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) command (0x00000040) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Identify::Commands::TriggerEffect::Type mRequest; -}; - -/* - * Attribute IdentifyTime - */ -class ReadIdentifyIdentifyTime : public ModelCommand -{ -public: - ReadIdentifyIdentifyTime() : ModelCommand("read") - { - AddArgument("attr-name", "identify-time"); - ModelCommand::AddArguments(); - } - - ~ReadIdentifyIdentifyTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::IdentifyCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "Identify.IdentifyTime response", value); - } -}; - -class WriteIdentifyIdentifyTime : public ModelCommand -{ -public: - WriteIdentifyIdentifyTime() : ModelCommand("write") - { - AddArgument("attr-name", "identify-time"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteIdentifyIdentifyTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) WriteAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::IdentifyCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint16_t mValue; -}; - -class ReportIdentifyIdentifyTime : public ModelCommand -{ -public: - ReportIdentifyIdentifyTime() : ModelCommand("subscribe") - { - AddArgument("attr-name", "identify-time"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportIdentifyIdentifyTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::IdentifyCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("Identify.IdentifyTime report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute IdentifyType - */ -class ReadIdentifyIdentifyType : public ModelCommand -{ -public: - ReadIdentifyIdentifyType() : ModelCommand("read") - { - AddArgument("attr-name", "identify-type"); - ModelCommand::AddArguments(); - } - - ~ReadIdentifyIdentifyType() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::IdentifyCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "Identify.IdentifyType response", value); - } -}; - -class ReportIdentifyIdentifyType : public ModelCommand -{ -public: - ReportIdentifyIdentifyType() : ModelCommand("subscribe") - { - AddArgument("attr-name", "identify-type"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportIdentifyIdentifyType() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::IdentifyCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("Identify.IdentifyType report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadIdentifyAttributeList : public ModelCommand -{ -public: - ReadIdentifyAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadIdentifyAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::IdentifyCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "Identify.AttributeList response", value); - } -}; - -class ReportIdentifyAttributeList : public ModelCommand -{ -public: - ReportIdentifyAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportIdentifyAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::IdentifyCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("Identify.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadIdentifyClusterRevision : public ModelCommand -{ -public: - ReadIdentifyClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadIdentifyClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::IdentifyCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "Identify.ClusterRevision response", value); - } -}; - -class ReportIdentifyClusterRevision : public ModelCommand -{ -public: - ReportIdentifyClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportIdentifyClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000003) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::IdentifyCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("Identify.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster IlluminanceMeasurement | 0x0400 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * MeasuredValue | 0x0000 | -| * MinMeasuredValue | 0x0001 | -| * MaxMeasuredValue | 0x0002 | -| * Tolerance | 0x0003 | -| * LightSensorType | 0x0004 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Attribute MeasuredValue - */ -class ReadIlluminanceMeasurementMeasuredValue : public ModelCommand -{ -public: - ReadIlluminanceMeasurementMeasuredValue() : ModelCommand("read") - { - AddArgument("attr-name", "measured-value"); - ModelCommand::AddArguments(); - } - - ~ReadIlluminanceMeasurementMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::IlluminanceMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "IlluminanceMeasurement.MeasuredValue response", value); - } -}; - -class ReportIlluminanceMeasurementMeasuredValue : public ModelCommand -{ -public: - ReportIlluminanceMeasurementMeasuredValue() : ModelCommand("subscribe") - { - AddArgument("attr-name", "measured-value"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportIlluminanceMeasurementMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::IlluminanceMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("IlluminanceMeasurement.MeasuredValue report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MinMeasuredValue - */ -class ReadIlluminanceMeasurementMinMeasuredValue : public ModelCommand -{ -public: - ReadIlluminanceMeasurementMinMeasuredValue() : ModelCommand("read") - { - AddArgument("attr-name", "min-measured-value"); - ModelCommand::AddArguments(); - } - - ~ReadIlluminanceMeasurementMinMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::IlluminanceMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "IlluminanceMeasurement.MinMeasuredValue response", value); - } -}; - -class ReportIlluminanceMeasurementMinMeasuredValue : public ModelCommand -{ -public: - ReportIlluminanceMeasurementMinMeasuredValue() : ModelCommand("subscribe") - { - AddArgument("attr-name", "min-measured-value"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportIlluminanceMeasurementMinMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::IlluminanceMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("IlluminanceMeasurement.MinMeasuredValue report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MaxMeasuredValue - */ -class ReadIlluminanceMeasurementMaxMeasuredValue : public ModelCommand -{ -public: - ReadIlluminanceMeasurementMaxMeasuredValue() : ModelCommand("read") - { - AddArgument("attr-name", "max-measured-value"); - ModelCommand::AddArguments(); - } - - ~ReadIlluminanceMeasurementMaxMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::IlluminanceMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "IlluminanceMeasurement.MaxMeasuredValue response", value); - } -}; - -class ReportIlluminanceMeasurementMaxMeasuredValue : public ModelCommand -{ -public: - ReportIlluminanceMeasurementMaxMeasuredValue() : ModelCommand("subscribe") - { - AddArgument("attr-name", "max-measured-value"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportIlluminanceMeasurementMaxMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::IlluminanceMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("IlluminanceMeasurement.MaxMeasuredValue report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Tolerance - */ -class ReadIlluminanceMeasurementTolerance : public ModelCommand -{ -public: - ReadIlluminanceMeasurementTolerance() : ModelCommand("read") - { - AddArgument("attr-name", "tolerance"); - ModelCommand::AddArguments(); - } - - ~ReadIlluminanceMeasurementTolerance() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::IlluminanceMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "IlluminanceMeasurement.Tolerance response", value); - } -}; - -class ReportIlluminanceMeasurementTolerance : public ModelCommand -{ -public: - ReportIlluminanceMeasurementTolerance() : ModelCommand("subscribe") - { - AddArgument("attr-name", "tolerance"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportIlluminanceMeasurementTolerance() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::IlluminanceMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("IlluminanceMeasurement.Tolerance report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute LightSensorType - */ -class ReadIlluminanceMeasurementLightSensorType : public ModelCommand -{ -public: - ReadIlluminanceMeasurementLightSensorType() : ModelCommand("read") - { - AddArgument("attr-name", "light-sensor-type"); - ModelCommand::AddArguments(); - } - - ~ReadIlluminanceMeasurementLightSensorType() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::IlluminanceMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "IlluminanceMeasurement.LightSensorType response", value); - } -}; - -class ReportIlluminanceMeasurementLightSensorType : public ModelCommand -{ -public: - ReportIlluminanceMeasurementLightSensorType() : ModelCommand("subscribe") - { - AddArgument("attr-name", "light-sensor-type"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportIlluminanceMeasurementLightSensorType() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::IlluminanceMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("IlluminanceMeasurement.LightSensorType report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadIlluminanceMeasurementAttributeList : public ModelCommand -{ -public: - ReadIlluminanceMeasurementAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadIlluminanceMeasurementAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::IlluminanceMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "IlluminanceMeasurement.AttributeList response", value); - } -}; - -class ReportIlluminanceMeasurementAttributeList : public ModelCommand -{ -public: - ReportIlluminanceMeasurementAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportIlluminanceMeasurementAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::IlluminanceMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("IlluminanceMeasurement.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadIlluminanceMeasurementClusterRevision : public ModelCommand -{ -public: - ReadIlluminanceMeasurementClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadIlluminanceMeasurementClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::IlluminanceMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "IlluminanceMeasurement.ClusterRevision response", value); - } -}; - -class ReportIlluminanceMeasurementClusterRevision : public ModelCommand -{ -public: - ReportIlluminanceMeasurementClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportIlluminanceMeasurementClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000400) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::IlluminanceMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("IlluminanceMeasurement.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster KeypadInput | 0x0509 | -|------------------------------------------------------------------------------| -| Commands: | | -| * SendKeyRequest | 0x00 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command SendKeyRequest - */ -class KeypadInputSendKeyRequest : public ModelCommand -{ -public: - KeypadInputSendKeyRequest() : ModelCommand("send-key-request") - { - AddArgument("KeyCode", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.keyCode)); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000509) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnKeypadInputSendKeyResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::KeypadInput::Commands::SendKeyRequest::Type mRequest; -}; - -/* - * Attribute AttributeList - */ -class ReadKeypadInputAttributeList : public ModelCommand -{ -public: - ReadKeypadInputAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadKeypadInputAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000509) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::KeypadInputCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "KeypadInput.AttributeList response", value); - } -}; - -class ReportKeypadInputAttributeList : public ModelCommand -{ -public: - ReportKeypadInputAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportKeypadInputAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000509) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::KeypadInputCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("KeypadInput.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadKeypadInputClusterRevision : public ModelCommand -{ -public: - ReadKeypadInputClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadKeypadInputClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000509) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::KeypadInputCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "KeypadInput.ClusterRevision response", value); - } -}; - -class ReportKeypadInputClusterRevision : public ModelCommand -{ -public: - ReportKeypadInputClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportKeypadInputClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000509) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::KeypadInputCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("KeypadInput.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster LevelControl | 0x0008 | -|------------------------------------------------------------------------------| -| Commands: | | -| * Move | 0x01 | -| * MoveToLevel | 0x00 | -| * MoveToLevelWithOnOff | 0x04 | -| * MoveWithOnOff | 0x05 | -| * Step | 0x02 | -| * StepWithOnOff | 0x06 | -| * Stop | 0x03 | -| * StopWithOnOff | 0x07 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * CurrentLevel | 0x0000 | -| * RemainingTime | 0x0001 | -| * MinLevel | 0x0002 | -| * MaxLevel | 0x0003 | -| * CurrentFrequency | 0x0004 | -| * MinFrequency | 0x0005 | -| * MaxFrequency | 0x0006 | -| * Options | 0x000F | -| * OnOffTransitionTime | 0x0010 | -| * OnLevel | 0x0011 | -| * OnTransitionTime | 0x0012 | -| * OffTransitionTime | 0x0013 | -| * DefaultMoveRate | 0x0014 | -| * StartUpCurrentLevel | 0x4000 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command Move - */ -class LevelControlMove : public ModelCommand -{ -public: - LevelControlMove() : ModelCommand("move") - { - AddArgument("MoveMode", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.moveMode)); - AddArgument("Rate", 0, UINT8_MAX, &mRequest.rate); - AddArgument("OptionMask", 0, UINT8_MAX, &mRequest.optionMask); - AddArgument("OptionOverride", 0, UINT8_MAX, &mRequest.optionOverride); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) command (0x00000001) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::LevelControl::Commands::Move::Type mRequest; -}; - -/* - * Command MoveToLevel - */ -class LevelControlMoveToLevel : public ModelCommand -{ -public: - LevelControlMoveToLevel() : ModelCommand("move-to-level") - { - AddArgument("Level", 0, UINT8_MAX, &mRequest.level); - AddArgument("TransitionTime", 0, UINT16_MAX, &mRequest.transitionTime); - AddArgument("OptionMask", 0, UINT8_MAX, &mRequest.optionMask); - AddArgument("OptionOverride", 0, UINT8_MAX, &mRequest.optionOverride); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type mRequest; -}; - -/* - * Command MoveToLevelWithOnOff - */ -class LevelControlMoveToLevelWithOnOff : public ModelCommand -{ -public: - LevelControlMoveToLevelWithOnOff() : ModelCommand("move-to-level-with-on-off") - { - AddArgument("Level", 0, UINT8_MAX, &mRequest.level); - AddArgument("TransitionTime", 0, UINT16_MAX, &mRequest.transitionTime); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) command (0x00000004) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::LevelControl::Commands::MoveToLevelWithOnOff::Type mRequest; -}; - -/* - * Command MoveWithOnOff - */ -class LevelControlMoveWithOnOff : public ModelCommand -{ -public: - LevelControlMoveWithOnOff() : ModelCommand("move-with-on-off") - { - AddArgument("MoveMode", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.moveMode)); - AddArgument("Rate", 0, UINT8_MAX, &mRequest.rate); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) command (0x00000005) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::LevelControl::Commands::MoveWithOnOff::Type mRequest; -}; - -/* - * Command Step - */ -class LevelControlStep : public ModelCommand -{ -public: - LevelControlStep() : ModelCommand("step") - { - AddArgument("StepMode", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.stepMode)); - AddArgument("StepSize", 0, UINT8_MAX, &mRequest.stepSize); - AddArgument("TransitionTime", 0, UINT16_MAX, &mRequest.transitionTime); - AddArgument("OptionMask", 0, UINT8_MAX, &mRequest.optionMask); - AddArgument("OptionOverride", 0, UINT8_MAX, &mRequest.optionOverride); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) command (0x00000002) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::LevelControl::Commands::Step::Type mRequest; -}; - -/* - * Command StepWithOnOff - */ -class LevelControlStepWithOnOff : public ModelCommand -{ -public: - LevelControlStepWithOnOff() : ModelCommand("step-with-on-off") - { - AddArgument("StepMode", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.stepMode)); - AddArgument("StepSize", 0, UINT8_MAX, &mRequest.stepSize); - AddArgument("TransitionTime", 0, UINT16_MAX, &mRequest.transitionTime); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) command (0x00000006) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::LevelControl::Commands::StepWithOnOff::Type mRequest; -}; - -/* - * Command Stop - */ -class LevelControlStop : public ModelCommand -{ -public: - LevelControlStop() : ModelCommand("stop") - { - AddArgument("OptionMask", 0, UINT8_MAX, &mRequest.optionMask); - AddArgument("OptionOverride", 0, UINT8_MAX, &mRequest.optionOverride); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) command (0x00000003) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::LevelControl::Commands::Stop::Type mRequest; -}; - -/* - * Command StopWithOnOff - */ -class LevelControlStopWithOnOff : public ModelCommand -{ -public: - LevelControlStopWithOnOff() : ModelCommand("stop-with-on-off") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) command (0x00000007) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::LevelControl::Commands::StopWithOnOff::Type mRequest; -}; - -/* - * Attribute CurrentLevel - */ -class ReadLevelControlCurrentLevel : public ModelCommand -{ -public: - ReadLevelControlCurrentLevel() : ModelCommand("read") - { - AddArgument("attr-name", "current-level"); - ModelCommand::AddArguments(); - } - - ~ReadLevelControlCurrentLevel() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "LevelControl.CurrentLevel response", value); - } -}; - -class ReportLevelControlCurrentLevel : public ModelCommand -{ -public: - ReportLevelControlCurrentLevel() : ModelCommand("subscribe") - { - AddArgument("attr-name", "current-level"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportLevelControlCurrentLevel() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("LevelControl.CurrentLevel report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute RemainingTime - */ -class ReadLevelControlRemainingTime : public ModelCommand -{ -public: - ReadLevelControlRemainingTime() : ModelCommand("read") - { - AddArgument("attr-name", "remaining-time"); - ModelCommand::AddArguments(); - } - - ~ReadLevelControlRemainingTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "LevelControl.RemainingTime response", value); - } -}; - -class ReportLevelControlRemainingTime : public ModelCommand -{ -public: - ReportLevelControlRemainingTime() : ModelCommand("subscribe") - { - AddArgument("attr-name", "remaining-time"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportLevelControlRemainingTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("LevelControl.RemainingTime report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MinLevel - */ -class ReadLevelControlMinLevel : public ModelCommand -{ -public: - ReadLevelControlMinLevel() : ModelCommand("read") - { - AddArgument("attr-name", "min-level"); - ModelCommand::AddArguments(); - } - - ~ReadLevelControlMinLevel() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "LevelControl.MinLevel response", value); - } -}; - -class ReportLevelControlMinLevel : public ModelCommand -{ -public: - ReportLevelControlMinLevel() : ModelCommand("subscribe") - { - AddArgument("attr-name", "min-level"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportLevelControlMinLevel() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("LevelControl.MinLevel report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MaxLevel - */ -class ReadLevelControlMaxLevel : public ModelCommand -{ -public: - ReadLevelControlMaxLevel() : ModelCommand("read") - { - AddArgument("attr-name", "max-level"); - ModelCommand::AddArguments(); - } - - ~ReadLevelControlMaxLevel() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "LevelControl.MaxLevel response", value); - } -}; - -class ReportLevelControlMaxLevel : public ModelCommand -{ -public: - ReportLevelControlMaxLevel() : ModelCommand("subscribe") - { - AddArgument("attr-name", "max-level"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportLevelControlMaxLevel() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("LevelControl.MaxLevel report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute CurrentFrequency - */ -class ReadLevelControlCurrentFrequency : public ModelCommand -{ -public: - ReadLevelControlCurrentFrequency() : ModelCommand("read") - { - AddArgument("attr-name", "current-frequency"); - ModelCommand::AddArguments(); - } - - ~ReadLevelControlCurrentFrequency() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "LevelControl.CurrentFrequency response", value); - } -}; - -class ReportLevelControlCurrentFrequency : public ModelCommand -{ -public: - ReportLevelControlCurrentFrequency() : ModelCommand("subscribe") - { - AddArgument("attr-name", "current-frequency"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportLevelControlCurrentFrequency() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("LevelControl.CurrentFrequency report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MinFrequency - */ -class ReadLevelControlMinFrequency : public ModelCommand -{ -public: - ReadLevelControlMinFrequency() : ModelCommand("read") - { - AddArgument("attr-name", "min-frequency"); - ModelCommand::AddArguments(); - } - - ~ReadLevelControlMinFrequency() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "LevelControl.MinFrequency response", value); - } -}; - -class ReportLevelControlMinFrequency : public ModelCommand -{ -public: - ReportLevelControlMinFrequency() : ModelCommand("subscribe") - { - AddArgument("attr-name", "min-frequency"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportLevelControlMinFrequency() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("LevelControl.MinFrequency report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MaxFrequency - */ -class ReadLevelControlMaxFrequency : public ModelCommand -{ -public: - ReadLevelControlMaxFrequency() : ModelCommand("read") - { - AddArgument("attr-name", "max-frequency"); - ModelCommand::AddArguments(); - } - - ~ReadLevelControlMaxFrequency() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "LevelControl.MaxFrequency response", value); - } -}; - -class ReportLevelControlMaxFrequency : public ModelCommand -{ -public: - ReportLevelControlMaxFrequency() : ModelCommand("subscribe") - { - AddArgument("attr-name", "max-frequency"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportLevelControlMaxFrequency() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("LevelControl.MaxFrequency report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Options - */ -class ReadLevelControlOptions : public ModelCommand -{ -public: - ReadLevelControlOptions() : ModelCommand("read") - { - AddArgument("attr-name", "options"); - ModelCommand::AddArguments(); - } - - ~ReadLevelControlOptions() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x0000000F) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "LevelControl.Options response", value); - } -}; - -class WriteLevelControlOptions : public ModelCommand -{ -public: - WriteLevelControlOptions() : ModelCommand("write") - { - AddArgument("attr-name", "options"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteLevelControlOptions() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x0000000F) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint8_t mValue; -}; - -class ReportLevelControlOptions : public ModelCommand -{ -public: - ReportLevelControlOptions() : ModelCommand("subscribe") - { - AddArgument("attr-name", "options"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportLevelControlOptions() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x0000000F) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) { DataModelLogger::LogValue("LevelControl.Options report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute OnOffTransitionTime - */ -class ReadLevelControlOnOffTransitionTime : public ModelCommand -{ -public: - ReadLevelControlOnOffTransitionTime() : ModelCommand("read") - { - AddArgument("attr-name", "on-off-transition-time"); - ModelCommand::AddArguments(); - } - - ~ReadLevelControlOnOffTransitionTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000010) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "LevelControl.OnOffTransitionTime response", value); - } -}; - -class WriteLevelControlOnOffTransitionTime : public ModelCommand -{ -public: - WriteLevelControlOnOffTransitionTime() : ModelCommand("write") - { - AddArgument("attr-name", "on-off-transition-time"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteLevelControlOnOffTransitionTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x00000010) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint16_t mValue; -}; - -class ReportLevelControlOnOffTransitionTime : public ModelCommand -{ -public: - ReportLevelControlOnOffTransitionTime() : ModelCommand("subscribe") - { - AddArgument("attr-name", "on-off-transition-time"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportLevelControlOnOffTransitionTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000010) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("LevelControl.OnOffTransitionTime report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute OnLevel - */ -class ReadLevelControlOnLevel : public ModelCommand -{ -public: - ReadLevelControlOnLevel() : ModelCommand("read") - { - AddArgument("attr-name", "on-level"); - ModelCommand::AddArguments(); - } - - ~ReadLevelControlOnLevel() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000011) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "LevelControl.OnLevel response", value); - } -}; - -class WriteLevelControlOnLevel : public ModelCommand -{ -public: - WriteLevelControlOnLevel() : ModelCommand("write") - { - AddArgument("attr-name", "on-level"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteLevelControlOnLevel() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x00000011) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportLevelControlOnLevel : public ModelCommand -{ -public: - ReportLevelControlOnLevel() : ModelCommand("subscribe") - { - AddArgument("attr-name", "on-level"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportLevelControlOnLevel() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000011) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("LevelControl.OnLevel report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute OnTransitionTime - */ -class ReadLevelControlOnTransitionTime : public ModelCommand -{ -public: - ReadLevelControlOnTransitionTime() : ModelCommand("read") - { - AddArgument("attr-name", "on-transition-time"); - ModelCommand::AddArguments(); - } - - ~ReadLevelControlOnTransitionTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000012) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "LevelControl.OnTransitionTime response", value); - } -}; - -class WriteLevelControlOnTransitionTime : public ModelCommand -{ -public: - WriteLevelControlOnTransitionTime() : ModelCommand("write") - { - AddArgument("attr-name", "on-transition-time"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteLevelControlOnTransitionTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x00000012) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportLevelControlOnTransitionTime : public ModelCommand -{ -public: - ReportLevelControlOnTransitionTime() : ModelCommand("subscribe") - { - AddArgument("attr-name", "on-transition-time"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportLevelControlOnTransitionTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000012) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("LevelControl.OnTransitionTime report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute OffTransitionTime - */ -class ReadLevelControlOffTransitionTime : public ModelCommand -{ -public: - ReadLevelControlOffTransitionTime() : ModelCommand("read") - { - AddArgument("attr-name", "off-transition-time"); - ModelCommand::AddArguments(); - } - - ~ReadLevelControlOffTransitionTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000013) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "LevelControl.OffTransitionTime response", value); - } -}; - -class WriteLevelControlOffTransitionTime : public ModelCommand -{ -public: - WriteLevelControlOffTransitionTime() : ModelCommand("write") - { - AddArgument("attr-name", "off-transition-time"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteLevelControlOffTransitionTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x00000013) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportLevelControlOffTransitionTime : public ModelCommand -{ -public: - ReportLevelControlOffTransitionTime() : ModelCommand("subscribe") - { - AddArgument("attr-name", "off-transition-time"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportLevelControlOffTransitionTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000013) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("LevelControl.OffTransitionTime report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute DefaultMoveRate - */ -class ReadLevelControlDefaultMoveRate : public ModelCommand -{ -public: - ReadLevelControlDefaultMoveRate() : ModelCommand("read") - { - AddArgument("attr-name", "default-move-rate"); - ModelCommand::AddArguments(); - } - - ~ReadLevelControlDefaultMoveRate() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00000014) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "LevelControl.DefaultMoveRate response", value); - } -}; - -class WriteLevelControlDefaultMoveRate : public ModelCommand -{ -public: - WriteLevelControlDefaultMoveRate() : ModelCommand("write") - { - AddArgument("attr-name", "default-move-rate"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteLevelControlDefaultMoveRate() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x00000014) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportLevelControlDefaultMoveRate : public ModelCommand -{ -public: - ReportLevelControlDefaultMoveRate() : ModelCommand("subscribe") - { - AddArgument("attr-name", "default-move-rate"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportLevelControlDefaultMoveRate() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00000014) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("LevelControl.DefaultMoveRate report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute StartUpCurrentLevel - */ -class ReadLevelControlStartUpCurrentLevel : public ModelCommand -{ -public: - ReadLevelControlStartUpCurrentLevel() : ModelCommand("read") - { - AddArgument("attr-name", "start-up-current-level"); - ModelCommand::AddArguments(); - } - - ~ReadLevelControlStartUpCurrentLevel() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x00004000) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "LevelControl.StartUpCurrentLevel response", value); - } -}; - -class WriteLevelControlStartUpCurrentLevel : public ModelCommand -{ -public: - WriteLevelControlStartUpCurrentLevel() : ModelCommand("write") - { - AddArgument("attr-name", "start-up-current-level"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteLevelControlStartUpCurrentLevel() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) WriteAttribute (0x00004000) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportLevelControlStartUpCurrentLevel : public ModelCommand -{ -public: - ReportLevelControlStartUpCurrentLevel() : ModelCommand("subscribe") - { - AddArgument("attr-name", "start-up-current-level"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportLevelControlStartUpCurrentLevel() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x00004000) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("LevelControl.StartUpCurrentLevel report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadLevelControlAttributeList : public ModelCommand -{ -public: - ReadLevelControlAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadLevelControlAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "LevelControl.AttributeList response", value); - } -}; - -class ReportLevelControlAttributeList : public ModelCommand -{ -public: - ReportLevelControlAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportLevelControlAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("LevelControl.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute FeatureMap - */ -class ReadLevelControlFeatureMap : public ModelCommand -{ -public: - ReadLevelControlFeatureMap() : ModelCommand("read") - { - AddArgument("attr-name", "feature-map"); - ModelCommand::AddArguments(); - } - - ~ReadLevelControlFeatureMap() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x0000FFFC) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint32_t value) - { - OnGeneralAttributeEventResponse(context, "LevelControl.FeatureMap response", value); - } -}; - -class ReportLevelControlFeatureMap : public ModelCommand -{ -public: - ReportLevelControlFeatureMap() : ModelCommand("subscribe") - { - AddArgument("attr-name", "feature-map"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportLevelControlFeatureMap() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x0000FFFC) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint32_t value) - { - DataModelLogger::LogValue("LevelControl.FeatureMap report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadLevelControlClusterRevision : public ModelCommand -{ -public: - ReadLevelControlClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadLevelControlClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "LevelControl.ClusterRevision response", value); - } -}; - -class ReportLevelControlClusterRevision : public ModelCommand -{ -public: - ReportLevelControlClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportLevelControlClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000008) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::LevelControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("LevelControl.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster LocalizationConfiguration | 0x002B | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * ActiveLocale | 0x0001 | -| * SupportedLocales | 0x0002 | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Attribute ActiveLocale - */ -class ReadLocalizationConfigurationActiveLocale : public ModelCommand -{ -public: - ReadLocalizationConfigurationActiveLocale() : ModelCommand("read") - { - AddArgument("attr-name", "active-locale"); - ModelCommand::AddArguments(); - } - - ~ReadLocalizationConfigurationActiveLocale() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::LocalizationConfigurationCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::CharSpan value) - { - OnGeneralAttributeEventResponse(context, "LocalizationConfiguration.ActiveLocale response", value); - } -}; - -class WriteLocalizationConfigurationActiveLocale : public ModelCommand -{ -public: - WriteLocalizationConfigurationActiveLocale() : ModelCommand("write") - { - AddArgument("attr-name", "active-locale"); - AddArgument("attr-value", &mValue); - ModelCommand::AddArguments(); - } - - ~WriteLocalizationConfigurationActiveLocale() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002B) WriteAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::LocalizationConfigurationCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::CharSpan mValue; -}; - -class ReportLocalizationConfigurationActiveLocale : public ModelCommand -{ -public: - ReportLocalizationConfigurationActiveLocale() : ModelCommand("subscribe") - { - AddArgument("attr-name", "active-locale"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportLocalizationConfigurationActiveLocale() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::LocalizationConfigurationCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::CharSpan value) - { - DataModelLogger::LogValue("LocalizationConfiguration.ActiveLocale report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute SupportedLocales - */ -class ReadLocalizationConfigurationSupportedLocales : public ModelCommand -{ -public: - ReadLocalizationConfigurationSupportedLocales() : ModelCommand("read") - { - AddArgument("attr-name", "supported-locales"); - ModelCommand::AddArguments(); - } - - ~ReadLocalizationConfigurationSupportedLocales() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::LocalizationConfigurationCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "LocalizationConfiguration.SupportedLocales response", value); - } -}; - -class ReportLocalizationConfigurationSupportedLocales : public ModelCommand -{ -public: - ReportLocalizationConfigurationSupportedLocales() : ModelCommand("subscribe") - { - AddArgument("attr-name", "supported-locales"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportLocalizationConfigurationSupportedLocales() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::LocalizationConfigurationCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("LocalizationConfiguration.SupportedLocales report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadLocalizationConfigurationClusterRevision : public ModelCommand -{ -public: - ReadLocalizationConfigurationClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadLocalizationConfigurationClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002B) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::LocalizationConfigurationCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "LocalizationConfiguration.ClusterRevision response", value); - } -}; - -/*----------------------------------------------------------------------------*\ -| Cluster LowPower | 0x0508 | -|------------------------------------------------------------------------------| -| Commands: | | -| * Sleep | 0x00 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command Sleep - */ -class LowPowerSleep : public ModelCommand -{ -public: - LowPowerSleep() : ModelCommand("sleep") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000508) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::LowPower::Commands::Sleep::Type mRequest; -}; - -/* - * Attribute AttributeList - */ -class ReadLowPowerAttributeList : public ModelCommand -{ -public: - ReadLowPowerAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadLowPowerAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000508) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::LowPowerCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "LowPower.AttributeList response", value); - } -}; - -class ReportLowPowerAttributeList : public ModelCommand -{ -public: - ReportLowPowerAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportLowPowerAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000508) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::LowPowerCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("LowPower.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadLowPowerClusterRevision : public ModelCommand -{ -public: - ReadLowPowerClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadLowPowerClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000508) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::LowPowerCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "LowPower.ClusterRevision response", value); - } -}; - -class ReportLowPowerClusterRevision : public ModelCommand -{ -public: - ReportLowPowerClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportLowPowerClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000508) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::LowPowerCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("LowPower.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster MediaInput | 0x0507 | -|------------------------------------------------------------------------------| -| Commands: | | -| * HideInputStatusRequest | 0x02 | -| * RenameInputRequest | 0x03 | -| * SelectInputRequest | 0x00 | -| * ShowInputStatusRequest | 0x01 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * MediaInputList | 0x0000 | -| * CurrentMediaInput | 0x0001 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command HideInputStatusRequest - */ -class MediaInputHideInputStatusRequest : public ModelCommand -{ -public: - MediaInputHideInputStatusRequest() : ModelCommand("hide-input-status-request") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) command (0x00000002) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::MediaInput::Commands::HideInputStatusRequest::Type mRequest; -}; - -/* - * Command RenameInputRequest - */ -class MediaInputRenameInputRequest : public ModelCommand -{ -public: - MediaInputRenameInputRequest() : ModelCommand("rename-input-request") - { - AddArgument("Index", 0, UINT8_MAX, &mRequest.index); - AddArgument("Name", &mRequest.name); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) command (0x00000003) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::MediaInput::Commands::RenameInputRequest::Type mRequest; -}; - -/* - * Command SelectInputRequest - */ -class MediaInputSelectInputRequest : public ModelCommand -{ -public: - MediaInputSelectInputRequest() : ModelCommand("select-input-request") - { - AddArgument("Index", 0, UINT8_MAX, &mRequest.index); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::MediaInput::Commands::SelectInputRequest::Type mRequest; -}; - -/* - * Command ShowInputStatusRequest - */ -class MediaInputShowInputStatusRequest : public ModelCommand -{ -public: - MediaInputShowInputStatusRequest() : ModelCommand("show-input-status-request") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) command (0x00000001) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::MediaInput::Commands::ShowInputStatusRequest::Type mRequest; -}; - -/* - * Attribute MediaInputList - */ -class ReadMediaInputMediaInputList : public ModelCommand -{ -public: - ReadMediaInputMediaInputList() : ModelCommand("read") - { - AddArgument("attr-name", "media-input-list"); - ModelCommand::AddArguments(); - } - - ~ReadMediaInputMediaInputList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::MediaInputCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse( - void * context, - const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "MediaInput.MediaInputList response", value); - } -}; - -class ReportMediaInputMediaInputList : public ModelCommand -{ -public: - ReportMediaInputMediaInputList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "media-input-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportMediaInputMediaInputList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::MediaInputCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport( - void * context, - const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("MediaInput.MediaInputList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute CurrentMediaInput - */ -class ReadMediaInputCurrentMediaInput : public ModelCommand -{ -public: - ReadMediaInputCurrentMediaInput() : ModelCommand("read") - { - AddArgument("attr-name", "current-media-input"); - ModelCommand::AddArguments(); - } - - ~ReadMediaInputCurrentMediaInput() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::MediaInputCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "MediaInput.CurrentMediaInput response", value); - } -}; - -class ReportMediaInputCurrentMediaInput : public ModelCommand -{ -public: - ReportMediaInputCurrentMediaInput() : ModelCommand("subscribe") - { - AddArgument("attr-name", "current-media-input"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportMediaInputCurrentMediaInput() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::MediaInputCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("MediaInput.CurrentMediaInput report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadMediaInputAttributeList : public ModelCommand -{ -public: - ReadMediaInputAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadMediaInputAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::MediaInputCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "MediaInput.AttributeList response", value); - } -}; - -class ReportMediaInputAttributeList : public ModelCommand -{ -public: - ReportMediaInputAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportMediaInputAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::MediaInputCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("MediaInput.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadMediaInputClusterRevision : public ModelCommand -{ -public: - ReadMediaInputClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadMediaInputClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::MediaInputCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "MediaInput.ClusterRevision response", value); - } -}; - -class ReportMediaInputClusterRevision : public ModelCommand -{ -public: - ReportMediaInputClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportMediaInputClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000507) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::MediaInputCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("MediaInput.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster MediaPlayback | 0x0506 | -|------------------------------------------------------------------------------| -| Commands: | | -| * FastForwardRequest | 0x07 | -| * NextRequest | 0x05 | -| * PauseRequest | 0x01 | -| * PlayRequest | 0x00 | -| * PreviousRequest | 0x04 | -| * RewindRequest | 0x06 | -| * SeekRequest | 0x0B | -| * SkipBackwardRequest | 0x09 | -| * SkipForwardRequest | 0x08 | -| * StartOverRequest | 0x03 | -| * StopRequest | 0x02 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * PlaybackState | 0x0000 | -| * StartTime | 0x0001 | -| * Duration | 0x0002 | -| * PlaybackSpeed | 0x0004 | -| * SeekRangeEnd | 0x0005 | -| * SeekRangeStart | 0x0006 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command FastForwardRequest - */ -class MediaPlaybackFastForwardRequest : public ModelCommand -{ -public: - MediaPlaybackFastForwardRequest() : ModelCommand("fast-forward-request") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000007) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackPlaybackResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::MediaPlayback::Commands::FastForwardRequest::Type mRequest; -}; - -/* - * Command NextRequest - */ -class MediaPlaybackNextRequest : public ModelCommand -{ -public: - MediaPlaybackNextRequest() : ModelCommand("next-request") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000005) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackPlaybackResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::MediaPlayback::Commands::NextRequest::Type mRequest; -}; - -/* - * Command PauseRequest - */ -class MediaPlaybackPauseRequest : public ModelCommand -{ -public: - MediaPlaybackPauseRequest() : ModelCommand("pause-request") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000001) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackPlaybackResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::MediaPlayback::Commands::PauseRequest::Type mRequest; -}; - -/* - * Command PlayRequest - */ -class MediaPlaybackPlayRequest : public ModelCommand -{ -public: - MediaPlaybackPlayRequest() : ModelCommand("play-request") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackPlaybackResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::MediaPlayback::Commands::PlayRequest::Type mRequest; -}; - -/* - * Command PreviousRequest - */ -class MediaPlaybackPreviousRequest : public ModelCommand -{ -public: - MediaPlaybackPreviousRequest() : ModelCommand("previous-request") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000004) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackPlaybackResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::MediaPlayback::Commands::PreviousRequest::Type mRequest; -}; - -/* - * Command RewindRequest - */ -class MediaPlaybackRewindRequest : public ModelCommand -{ -public: - MediaPlaybackRewindRequest() : ModelCommand("rewind-request") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000006) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackPlaybackResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::MediaPlayback::Commands::RewindRequest::Type mRequest; -}; - -/* - * Command SeekRequest - */ -class MediaPlaybackSeekRequest : public ModelCommand -{ -public: - MediaPlaybackSeekRequest() : ModelCommand("seek-request") - { - AddArgument("Position", 0, UINT64_MAX, &mRequest.position); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x0000000B) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackPlaybackResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::MediaPlayback::Commands::SeekRequest::Type mRequest; -}; - -/* - * Command SkipBackwardRequest - */ -class MediaPlaybackSkipBackwardRequest : public ModelCommand -{ -public: - MediaPlaybackSkipBackwardRequest() : ModelCommand("skip-backward-request") - { - AddArgument("DeltaPositionMilliseconds", 0, UINT64_MAX, &mRequest.deltaPositionMilliseconds); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000009) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackPlaybackResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::MediaPlayback::Commands::SkipBackwardRequest::Type mRequest; -}; - -/* - * Command SkipForwardRequest - */ -class MediaPlaybackSkipForwardRequest : public ModelCommand -{ -public: - MediaPlaybackSkipForwardRequest() : ModelCommand("skip-forward-request") - { - AddArgument("DeltaPositionMilliseconds", 0, UINT64_MAX, &mRequest.deltaPositionMilliseconds); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000008) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackPlaybackResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::MediaPlayback::Commands::SkipForwardRequest::Type mRequest; -}; - -/* - * Command StartOverRequest - */ -class MediaPlaybackStartOverRequest : public ModelCommand -{ -public: - MediaPlaybackStartOverRequest() : ModelCommand("start-over-request") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000003) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackPlaybackResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::MediaPlayback::Commands::StartOverRequest::Type mRequest; -}; - -/* - * Command StopRequest - */ -class MediaPlaybackStopRequest : public ModelCommand -{ -public: - MediaPlaybackStopRequest() : ModelCommand("stop-request") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000002) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackPlaybackResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::MediaPlayback::Commands::StopRequest::Type mRequest; -}; - -/* - * Attribute PlaybackState - */ -class ReadMediaPlaybackPlaybackState : public ModelCommand -{ -public: - ReadMediaPlaybackPlaybackState() : ModelCommand("read") - { - AddArgument("attr-name", "playback-state"); - ModelCommand::AddArguments(); - } - - ~ReadMediaPlaybackPlaybackState() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::MediaPlaybackCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::app::Clusters::MediaPlayback::PlaybackStateEnum value) - { - OnGeneralAttributeEventResponse(context, "MediaPlayback.PlaybackState response", value); - } -}; - -class ReportMediaPlaybackPlaybackState : public ModelCommand -{ -public: - ReportMediaPlaybackPlaybackState() : ModelCommand("subscribe") - { - AddArgument("attr-name", "playback-state"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportMediaPlaybackPlaybackState() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::MediaPlaybackCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::MediaPlayback::PlaybackStateEnum value) - { - DataModelLogger::LogValue("MediaPlayback.PlaybackState report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute StartTime - */ -class ReadMediaPlaybackStartTime : public ModelCommand -{ -public: - ReadMediaPlaybackStartTime() : ModelCommand("read") - { - AddArgument("attr-name", "start-time"); - ModelCommand::AddArguments(); - } - - ~ReadMediaPlaybackStartTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::MediaPlaybackCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint64_t value) - { - OnGeneralAttributeEventResponse(context, "MediaPlayback.StartTime response", value); - } -}; - -class ReportMediaPlaybackStartTime : public ModelCommand -{ -public: - ReportMediaPlaybackStartTime() : ModelCommand("subscribe") - { - AddArgument("attr-name", "start-time"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportMediaPlaybackStartTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::MediaPlaybackCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint64_t value) - { - DataModelLogger::LogValue("MediaPlayback.StartTime report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Duration - */ -class ReadMediaPlaybackDuration : public ModelCommand -{ -public: - ReadMediaPlaybackDuration() : ModelCommand("read") - { - AddArgument("attr-name", "duration"); - ModelCommand::AddArguments(); - } - - ~ReadMediaPlaybackDuration() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::MediaPlaybackCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint64_t value) - { - OnGeneralAttributeEventResponse(context, "MediaPlayback.Duration response", value); - } -}; - -class ReportMediaPlaybackDuration : public ModelCommand -{ -public: - ReportMediaPlaybackDuration() : ModelCommand("subscribe") - { - AddArgument("attr-name", "duration"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportMediaPlaybackDuration() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::MediaPlaybackCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint64_t value) - { - DataModelLogger::LogValue("MediaPlayback.Duration report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute PlaybackSpeed - */ -class ReadMediaPlaybackPlaybackSpeed : public ModelCommand -{ -public: - ReadMediaPlaybackPlaybackSpeed() : ModelCommand("read") - { - AddArgument("attr-name", "playback-speed"); - ModelCommand::AddArguments(); - } - - ~ReadMediaPlaybackPlaybackSpeed() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::MediaPlaybackCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, float value) - { - OnGeneralAttributeEventResponse(context, "MediaPlayback.PlaybackSpeed response", value); - } -}; - -class ReportMediaPlaybackPlaybackSpeed : public ModelCommand -{ -public: - ReportMediaPlaybackPlaybackSpeed() : ModelCommand("subscribe") - { - AddArgument("attr-name", "playback-speed"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportMediaPlaybackPlaybackSpeed() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::MediaPlaybackCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, float value) - { - DataModelLogger::LogValue("MediaPlayback.PlaybackSpeed report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute SeekRangeEnd - */ -class ReadMediaPlaybackSeekRangeEnd : public ModelCommand -{ -public: - ReadMediaPlaybackSeekRangeEnd() : ModelCommand("read") - { - AddArgument("attr-name", "seek-range-end"); - ModelCommand::AddArguments(); - } - - ~ReadMediaPlaybackSeekRangeEnd() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::MediaPlaybackCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint64_t value) - { - OnGeneralAttributeEventResponse(context, "MediaPlayback.SeekRangeEnd response", value); - } -}; - -class ReportMediaPlaybackSeekRangeEnd : public ModelCommand -{ -public: - ReportMediaPlaybackSeekRangeEnd() : ModelCommand("subscribe") - { - AddArgument("attr-name", "seek-range-end"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportMediaPlaybackSeekRangeEnd() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::MediaPlaybackCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint64_t value) - { - DataModelLogger::LogValue("MediaPlayback.SeekRangeEnd report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute SeekRangeStart - */ -class ReadMediaPlaybackSeekRangeStart : public ModelCommand -{ -public: - ReadMediaPlaybackSeekRangeStart() : ModelCommand("read") - { - AddArgument("attr-name", "seek-range-start"); - ModelCommand::AddArguments(); - } - - ~ReadMediaPlaybackSeekRangeStart() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::MediaPlaybackCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint64_t value) - { - OnGeneralAttributeEventResponse(context, "MediaPlayback.SeekRangeStart response", value); - } -}; - -class ReportMediaPlaybackSeekRangeStart : public ModelCommand -{ -public: - ReportMediaPlaybackSeekRangeStart() : ModelCommand("subscribe") - { - AddArgument("attr-name", "seek-range-start"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportMediaPlaybackSeekRangeStart() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::MediaPlaybackCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint64_t value) - { - DataModelLogger::LogValue("MediaPlayback.SeekRangeStart report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadMediaPlaybackAttributeList : public ModelCommand -{ -public: - ReadMediaPlaybackAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadMediaPlaybackAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::MediaPlaybackCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "MediaPlayback.AttributeList response", value); - } -}; - -class ReportMediaPlaybackAttributeList : public ModelCommand -{ -public: - ReportMediaPlaybackAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportMediaPlaybackAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::MediaPlaybackCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("MediaPlayback.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadMediaPlaybackClusterRevision : public ModelCommand -{ -public: - ReadMediaPlaybackClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadMediaPlaybackClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::MediaPlaybackCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "MediaPlayback.ClusterRevision response", value); - } -}; - -class ReportMediaPlaybackClusterRevision : public ModelCommand -{ -public: - ReportMediaPlaybackClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportMediaPlaybackClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::MediaPlaybackCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("MediaPlayback.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster ModeSelect | 0x0050 | -|------------------------------------------------------------------------------| -| Commands: | | -| * ChangeToMode | 0x00 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * CurrentMode | 0x0000 | -| * SupportedModes | 0x0001 | -| * OnMode | 0x0002 | -| * StartUpMode | 0x0003 | -| * Description | 0x0004 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command ChangeToMode - */ -class ModeSelectChangeToMode : public ModelCommand -{ -public: - ModeSelectChangeToMode() : ModelCommand("change-to-mode") - { - AddArgument("NewMode", 0, UINT8_MAX, &mRequest.newMode); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type mRequest; -}; - -/* - * Attribute CurrentMode - */ -class ReadModeSelectCurrentMode : public ModelCommand -{ -public: - ReadModeSelectCurrentMode() : ModelCommand("read") - { - AddArgument("attr-name", "current-mode"); - ModelCommand::AddArguments(); - } - - ~ReadModeSelectCurrentMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::ModeSelectCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "ModeSelect.CurrentMode response", value); - } -}; - -class ReportModeSelectCurrentMode : public ModelCommand -{ -public: - ReportModeSelectCurrentMode() : ModelCommand("subscribe") - { - AddArgument("attr-name", "current-mode"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportModeSelectCurrentMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::ModeSelectCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("ModeSelect.CurrentMode report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute SupportedModes - */ -class ReadModeSelectSupportedModes : public ModelCommand -{ -public: - ReadModeSelectSupportedModes() : ModelCommand("read") - { - AddArgument("attr-name", "supported-modes"); - ModelCommand::AddArguments(); - } - - ~ReadModeSelectSupportedModes() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::ModeSelectCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse( - void * context, - const chip::app::DataModel::DecodableList & - value) - { - OnGeneralAttributeEventResponse(context, "ModeSelect.SupportedModes response", value); - } -}; - -class ReportModeSelectSupportedModes : public ModelCommand -{ -public: - ReportModeSelectSupportedModes() : ModelCommand("subscribe") - { - AddArgument("attr-name", "supported-modes"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportModeSelectSupportedModes() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::ModeSelectCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport( - void * context, - const chip::app::DataModel::DecodableList & - value) - { - DataModelLogger::LogValue("ModeSelect.SupportedModes report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute OnMode - */ -class ReadModeSelectOnMode : public ModelCommand -{ -public: - ReadModeSelectOnMode() : ModelCommand("read") - { - AddArgument("attr-name", "on-mode"); - ModelCommand::AddArguments(); - } - - ~ReadModeSelectOnMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::ModeSelectCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "ModeSelect.OnMode response", value); - } -}; - -class WriteModeSelectOnMode : public ModelCommand -{ -public: - WriteModeSelectOnMode() : ModelCommand("write") - { - AddArgument("attr-name", "on-mode"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteModeSelectOnMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) WriteAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::ModeSelectCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint8_t mValue; -}; - -class ReportModeSelectOnMode : public ModelCommand -{ -public: - ReportModeSelectOnMode() : ModelCommand("subscribe") - { - AddArgument("attr-name", "on-mode"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportModeSelectOnMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::ModeSelectCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) { DataModelLogger::LogValue("ModeSelect.OnMode report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute StartUpMode - */ -class ReadModeSelectStartUpMode : public ModelCommand -{ -public: - ReadModeSelectStartUpMode() : ModelCommand("read") - { - AddArgument("attr-name", "start-up-mode"); - ModelCommand::AddArguments(); - } - - ~ReadModeSelectStartUpMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::ModeSelectCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "ModeSelect.StartUpMode response", value); - } -}; - -class ReportModeSelectStartUpMode : public ModelCommand -{ -public: - ReportModeSelectStartUpMode() : ModelCommand("subscribe") - { - AddArgument("attr-name", "start-up-mode"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportModeSelectStartUpMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::ModeSelectCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("ModeSelect.StartUpMode report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Description - */ -class ReadModeSelectDescription : public ModelCommand -{ -public: - ReadModeSelectDescription() : ModelCommand("read") - { - AddArgument("attr-name", "description"); - ModelCommand::AddArguments(); - } - - ~ReadModeSelectDescription() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::ModeSelectCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::CharSpan value) - { - OnGeneralAttributeEventResponse(context, "ModeSelect.Description response", value); - } -}; - -class ReportModeSelectDescription : public ModelCommand -{ -public: - ReportModeSelectDescription() : ModelCommand("subscribe") - { - AddArgument("attr-name", "description"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportModeSelectDescription() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::ModeSelectCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::CharSpan value) - { - DataModelLogger::LogValue("ModeSelect.Description report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadModeSelectAttributeList : public ModelCommand -{ -public: - ReadModeSelectAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadModeSelectAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::ModeSelectCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "ModeSelect.AttributeList response", value); - } -}; - -class ReportModeSelectAttributeList : public ModelCommand -{ -public: - ReportModeSelectAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportModeSelectAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::ModeSelectCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("ModeSelect.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadModeSelectClusterRevision : public ModelCommand -{ -public: - ReadModeSelectClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadModeSelectClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::ModeSelectCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "ModeSelect.ClusterRevision response", value); - } -}; - -class ReportModeSelectClusterRevision : public ModelCommand -{ -public: - ReportModeSelectClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportModeSelectClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::ModeSelectCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("ModeSelect.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster NetworkCommissioning | 0x0031 | -|------------------------------------------------------------------------------| -| Commands: | | -| * AddOrUpdateThreadNetwork | 0x03 | -| * AddOrUpdateWiFiNetwork | 0x02 | -| * ConnectNetwork | 0x06 | -| * RemoveNetwork | 0x04 | -| * ReorderNetwork | 0x08 | -| * ScanNetworks | 0x00 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * MaxNetworks | 0x0000 | -| * Networks | 0x0001 | -| * ScanMaxTimeSeconds | 0x0002 | -| * ConnectMaxTimeSeconds | 0x0003 | -| * InterfaceEnabled | 0x0004 | -| * LastNetworkingStatus | 0x0005 | -| * LastNetworkID | 0x0006 | -| * LastConnectErrorValue | 0x0007 | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command AddOrUpdateThreadNetwork - */ -class NetworkCommissioningAddOrUpdateThreadNetwork : public ModelCommand -{ -public: - NetworkCommissioningAddOrUpdateThreadNetwork() : ModelCommand("add-or-update-thread-network") - { - AddArgument("OperationalDataset", &mRequest.operationalDataset); - AddArgument("Breadcrumb", 0, UINT64_MAX, &mRequest.breadcrumb); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) command (0x00000003) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnNetworkCommissioningNetworkConfigResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::NetworkCommissioning::Commands::AddOrUpdateThreadNetwork::Type mRequest; -}; - -/* - * Command AddOrUpdateWiFiNetwork - */ -class NetworkCommissioningAddOrUpdateWiFiNetwork : public ModelCommand -{ -public: - NetworkCommissioningAddOrUpdateWiFiNetwork() : ModelCommand("add-or-update-wi-fi-network") - { - AddArgument("Ssid", &mRequest.ssid); - AddArgument("Credentials", &mRequest.credentials); - AddArgument("Breadcrumb", 0, UINT64_MAX, &mRequest.breadcrumb); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) command (0x00000002) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnNetworkCommissioningNetworkConfigResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::NetworkCommissioning::Commands::AddOrUpdateWiFiNetwork::Type mRequest; -}; - -/* - * Command ConnectNetwork - */ -class NetworkCommissioningConnectNetwork : public ModelCommand -{ -public: - NetworkCommissioningConnectNetwork() : ModelCommand("connect-network") - { - AddArgument("NetworkID", &mRequest.networkID); - AddArgument("Breadcrumb", 0, UINT64_MAX, &mRequest.breadcrumb); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) command (0x00000006) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnNetworkCommissioningConnectNetworkResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetwork::Type mRequest; -}; - -/* - * Command RemoveNetwork - */ -class NetworkCommissioningRemoveNetwork : public ModelCommand -{ -public: - NetworkCommissioningRemoveNetwork() : ModelCommand("remove-network") - { - AddArgument("NetworkID", &mRequest.networkID); - AddArgument("Breadcrumb", 0, UINT64_MAX, &mRequest.breadcrumb); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) command (0x00000004) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnNetworkCommissioningNetworkConfigResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::NetworkCommissioning::Commands::RemoveNetwork::Type mRequest; -}; - -/* - * Command ReorderNetwork - */ -class NetworkCommissioningReorderNetwork : public ModelCommand -{ -public: - NetworkCommissioningReorderNetwork() : ModelCommand("reorder-network") - { - AddArgument("NetworkID", &mRequest.networkID); - AddArgument("NetworkIndex", 0, UINT8_MAX, &mRequest.networkIndex); - AddArgument("Breadcrumb", 0, UINT64_MAX, &mRequest.breadcrumb); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) command (0x00000008) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnNetworkCommissioningNetworkConfigResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::NetworkCommissioning::Commands::ReorderNetwork::Type mRequest; -}; - -/* - * Command ScanNetworks - */ -class NetworkCommissioningScanNetworks : public ModelCommand -{ -public: - NetworkCommissioningScanNetworks() : ModelCommand("scan-networks") - { - AddArgument("Ssid", &mRequest.ssid); - AddArgument("Breadcrumb", 0, UINT64_MAX, &mRequest.breadcrumb); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnNetworkCommissioningScanNetworksResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworks::Type mRequest; -}; - -/* - * Attribute MaxNetworks - */ -class ReadNetworkCommissioningMaxNetworks : public ModelCommand -{ -public: - ReadNetworkCommissioningMaxNetworks() : ModelCommand("read") - { - AddArgument("attr-name", "max-networks"); - ModelCommand::AddArguments(); - } - - ~ReadNetworkCommissioningMaxNetworks() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::NetworkCommissioningCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "NetworkCommissioning.MaxNetworks response", value); - } -}; - -class ReportNetworkCommissioningMaxNetworks : public ModelCommand -{ -public: - ReportNetworkCommissioningMaxNetworks() : ModelCommand("subscribe") - { - AddArgument("attr-name", "max-networks"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportNetworkCommissioningMaxNetworks() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::NetworkCommissioningCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("NetworkCommissioning.MaxNetworks report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Networks - */ -class ReadNetworkCommissioningNetworks : public ModelCommand -{ -public: - ReadNetworkCommissioningNetworks() : ModelCommand("read") - { - AddArgument("attr-name", "networks"); - ModelCommand::AddArguments(); - } - - ~ReadNetworkCommissioningNetworks() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::NetworkCommissioningCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse( - void * context, - const chip::app::DataModel::DecodableList & - value) - { - OnGeneralAttributeEventResponse(context, "NetworkCommissioning.Networks response", value); - } -}; - -class ReportNetworkCommissioningNetworks : public ModelCommand -{ -public: - ReportNetworkCommissioningNetworks() : ModelCommand("subscribe") - { - AddArgument("attr-name", "networks"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportNetworkCommissioningNetworks() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::NetworkCommissioningCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport( - void * context, - const chip::app::DataModel::DecodableList & - value) - { - DataModelLogger::LogValue("NetworkCommissioning.Networks report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ScanMaxTimeSeconds - */ -class ReadNetworkCommissioningScanMaxTimeSeconds : public ModelCommand -{ -public: - ReadNetworkCommissioningScanMaxTimeSeconds() : ModelCommand("read") - { - AddArgument("attr-name", "scan-max-time-seconds"); - ModelCommand::AddArguments(); - } - - ~ReadNetworkCommissioningScanMaxTimeSeconds() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::NetworkCommissioningCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "NetworkCommissioning.ScanMaxTimeSeconds response", value); - } -}; - -class ReportNetworkCommissioningScanMaxTimeSeconds : public ModelCommand -{ -public: - ReportNetworkCommissioningScanMaxTimeSeconds() : ModelCommand("subscribe") - { - AddArgument("attr-name", "scan-max-time-seconds"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportNetworkCommissioningScanMaxTimeSeconds() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::NetworkCommissioningCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("NetworkCommissioning.ScanMaxTimeSeconds report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ConnectMaxTimeSeconds - */ -class ReadNetworkCommissioningConnectMaxTimeSeconds : public ModelCommand -{ -public: - ReadNetworkCommissioningConnectMaxTimeSeconds() : ModelCommand("read") - { - AddArgument("attr-name", "connect-max-time-seconds"); - ModelCommand::AddArguments(); - } - - ~ReadNetworkCommissioningConnectMaxTimeSeconds() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::NetworkCommissioningCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "NetworkCommissioning.ConnectMaxTimeSeconds response", value); - } -}; - -class ReportNetworkCommissioningConnectMaxTimeSeconds : public ModelCommand -{ -public: - ReportNetworkCommissioningConnectMaxTimeSeconds() : ModelCommand("subscribe") - { - AddArgument("attr-name", "connect-max-time-seconds"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportNetworkCommissioningConnectMaxTimeSeconds() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::NetworkCommissioningCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("NetworkCommissioning.ConnectMaxTimeSeconds report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute InterfaceEnabled - */ -class ReadNetworkCommissioningInterfaceEnabled : public ModelCommand -{ -public: - ReadNetworkCommissioningInterfaceEnabled() : ModelCommand("read") - { - AddArgument("attr-name", "interface-enabled"); - ModelCommand::AddArguments(); - } - - ~ReadNetworkCommissioningInterfaceEnabled() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::NetworkCommissioningCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, bool value) - { - OnGeneralAttributeEventResponse(context, "NetworkCommissioning.InterfaceEnabled response", value); - } -}; - -class WriteNetworkCommissioningInterfaceEnabled : public ModelCommand -{ -public: - WriteNetworkCommissioningInterfaceEnabled() : ModelCommand("write") - { - AddArgument("attr-name", "interface-enabled"); - AddArgument("attr-value", 0, 1, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteNetworkCommissioningInterfaceEnabled() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) WriteAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::NetworkCommissioningCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - bool mValue; -}; - -class ReportNetworkCommissioningInterfaceEnabled : public ModelCommand -{ -public: - ReportNetworkCommissioningInterfaceEnabled() : ModelCommand("subscribe") - { - AddArgument("attr-name", "interface-enabled"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportNetworkCommissioningInterfaceEnabled() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::NetworkCommissioningCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, bool value) - { - DataModelLogger::LogValue("NetworkCommissioning.InterfaceEnabled report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute LastNetworkingStatus - */ -class ReadNetworkCommissioningLastNetworkingStatus : public ModelCommand -{ -public: - ReadNetworkCommissioningLastNetworkingStatus() : ModelCommand("read") - { - AddArgument("attr-name", "last-networking-status"); - ModelCommand::AddArguments(); - } - - ~ReadNetworkCommissioningLastNetworkingStatus() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::NetworkCommissioningCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::app::Clusters::NetworkCommissioning::NetworkCommissioningStatus value) - { - OnGeneralAttributeEventResponse(context, "NetworkCommissioning.LastNetworkingStatus response", value); - } -}; - -class ReportNetworkCommissioningLastNetworkingStatus : public ModelCommand -{ -public: - ReportNetworkCommissioningLastNetworkingStatus() : ModelCommand("subscribe") - { - AddArgument("attr-name", "last-networking-status"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportNetworkCommissioningLastNetworkingStatus() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::NetworkCommissioningCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::NetworkCommissioning::NetworkCommissioningStatus value) - { - DataModelLogger::LogValue("NetworkCommissioning.LastNetworkingStatus report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute LastNetworkID - */ -class ReadNetworkCommissioningLastNetworkID : public ModelCommand -{ -public: - ReadNetworkCommissioningLastNetworkID() : ModelCommand("read") - { - AddArgument("attr-name", "last-network-id"); - ModelCommand::AddArguments(); - } - - ~ReadNetworkCommissioningLastNetworkID() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::NetworkCommissioningCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::ByteSpan value) - { - OnGeneralAttributeEventResponse(context, "NetworkCommissioning.LastNetworkID response", value); - } -}; - -class ReportNetworkCommissioningLastNetworkID : public ModelCommand -{ -public: - ReportNetworkCommissioningLastNetworkID() : ModelCommand("subscribe") - { - AddArgument("attr-name", "last-network-id"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportNetworkCommissioningLastNetworkID() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::NetworkCommissioningCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::ByteSpan value) - { - DataModelLogger::LogValue("NetworkCommissioning.LastNetworkID report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute LastConnectErrorValue - */ -class ReadNetworkCommissioningLastConnectErrorValue : public ModelCommand -{ -public: - ReadNetworkCommissioningLastConnectErrorValue() : ModelCommand("read") - { - AddArgument("attr-name", "last-connect-error-value"); - ModelCommand::AddArguments(); - } - - ~ReadNetworkCommissioningLastConnectErrorValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x00000007) on endpoint %" PRIu16, endpointId); - - chip::Controller::NetworkCommissioningCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint32_t value) - { - OnGeneralAttributeEventResponse(context, "NetworkCommissioning.LastConnectErrorValue response", value); - } -}; - -class ReportNetworkCommissioningLastConnectErrorValue : public ModelCommand -{ -public: - ReportNetworkCommissioningLastConnectErrorValue() : ModelCommand("subscribe") - { - AddArgument("attr-name", "last-connect-error-value"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportNetworkCommissioningLastConnectErrorValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x00000007) on endpoint %" PRIu16, endpointId); - - chip::Controller::NetworkCommissioningCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint32_t value) - { - DataModelLogger::LogValue("NetworkCommissioning.LastConnectErrorValue report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute FeatureMap - */ -class ReadNetworkCommissioningFeatureMap : public ModelCommand -{ -public: - ReadNetworkCommissioningFeatureMap() : ModelCommand("read") - { - AddArgument("attr-name", "feature-map"); - ModelCommand::AddArguments(); - } - - ~ReadNetworkCommissioningFeatureMap() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x0000FFFC) on endpoint %" PRIu16, endpointId); - - chip::Controller::NetworkCommissioningCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint32_t value) - { - OnGeneralAttributeEventResponse(context, "NetworkCommissioning.FeatureMap response", value); - } -}; - -class ReportNetworkCommissioningFeatureMap : public ModelCommand -{ -public: - ReportNetworkCommissioningFeatureMap() : ModelCommand("subscribe") - { - AddArgument("attr-name", "feature-map"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportNetworkCommissioningFeatureMap() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x0000FFFC) on endpoint %" PRIu16, endpointId); - - chip::Controller::NetworkCommissioningCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint32_t value) - { - DataModelLogger::LogValue("NetworkCommissioning.FeatureMap report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadNetworkCommissioningClusterRevision : public ModelCommand -{ -public: - ReadNetworkCommissioningClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadNetworkCommissioningClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::NetworkCommissioningCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "NetworkCommissioning.ClusterRevision response", value); - } -}; - -class ReportNetworkCommissioningClusterRevision : public ModelCommand -{ -public: - ReportNetworkCommissioningClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportNetworkCommissioningClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000031) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::NetworkCommissioningCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("NetworkCommissioning.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster OtaSoftwareUpdateProvider | 0x0029 | -|------------------------------------------------------------------------------| -| Commands: | | -| * ApplyUpdateRequest | 0x02 | -| * NotifyUpdateApplied | 0x04 | -| * QueryImage | 0x00 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command ApplyUpdateRequest - */ -class OtaSoftwareUpdateProviderApplyUpdateRequest : public ModelCommand -{ -public: - OtaSoftwareUpdateProviderApplyUpdateRequest() : ModelCommand("apply-update-request") - { - AddArgument("UpdateToken", &mRequest.updateToken); - AddArgument("NewVersion", 0, UINT32_MAX, &mRequest.newVersion); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000029) command (0x00000002) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnOtaSoftwareUpdateProviderApplyUpdateResponseSuccess, - OnDefaultFailure, endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::Type mRequest; -}; - -/* - * Command NotifyUpdateApplied - */ -class OtaSoftwareUpdateProviderNotifyUpdateApplied : public ModelCommand -{ -public: - OtaSoftwareUpdateProviderNotifyUpdateApplied() : ModelCommand("notify-update-applied") - { - AddArgument("UpdateToken", &mRequest.updateToken); - AddArgument("SoftwareVersion", 0, UINT32_MAX, &mRequest.softwareVersion); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000029) command (0x00000004) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::Type mRequest; -}; - -/* - * Command QueryImage - */ -class OtaSoftwareUpdateProviderQueryImage : public ModelCommand -{ -public: - OtaSoftwareUpdateProviderQueryImage() : ModelCommand("query-image"), mComplex_ProtocolsSupported(&mRequest.protocolsSupported) - { - AddArgument("VendorId", 0, UINT16_MAX, &mRequest.vendorId); - AddArgument("ProductId", 0, UINT16_MAX, &mRequest.productId); - AddArgument("SoftwareVersion", 0, UINT32_MAX, &mRequest.softwareVersion); - AddArgument("ProtocolsSupported", &mComplex_ProtocolsSupported); - AddArgument("HardwareVersion", 0, UINT16_MAX, &mRequest.hardwareVersion); - AddArgument("Location", &mRequest.location); - AddArgument("RequestorCanConsent", 0, 1, &mRequest.requestorCanConsent); - AddArgument("MetadataForProvider", &mRequest.metadataForProvider); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000029) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnOtaSoftwareUpdateProviderQueryImageResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImage::Type mRequest; - TypedComplexArgument> - mComplex_ProtocolsSupported; -}; - -/* - * Attribute AttributeList - */ -class ReadOtaSoftwareUpdateProviderAttributeList : public ModelCommand -{ -public: - ReadOtaSoftwareUpdateProviderAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadOtaSoftwareUpdateProviderAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000029) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::OtaSoftwareUpdateProviderCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "OtaSoftwareUpdateProvider.AttributeList response", value); - } -}; - -class ReportOtaSoftwareUpdateProviderAttributeList : public ModelCommand -{ -public: - ReportOtaSoftwareUpdateProviderAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOtaSoftwareUpdateProviderAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000029) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::OtaSoftwareUpdateProviderCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("OtaSoftwareUpdateProvider.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadOtaSoftwareUpdateProviderClusterRevision : public ModelCommand -{ -public: - ReadOtaSoftwareUpdateProviderClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadOtaSoftwareUpdateProviderClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000029) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::OtaSoftwareUpdateProviderCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "OtaSoftwareUpdateProvider.ClusterRevision response", value); - } -}; - -class ReportOtaSoftwareUpdateProviderClusterRevision : public ModelCommand -{ -public: - ReportOtaSoftwareUpdateProviderClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOtaSoftwareUpdateProviderClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000029) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::OtaSoftwareUpdateProviderCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("OtaSoftwareUpdateProvider.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster OtaSoftwareUpdateRequestor | 0x002A | -|------------------------------------------------------------------------------| -| Commands: | | -| * AnnounceOtaProvider | 0x00 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * DefaultOtaProviders | 0x0000 | -| * UpdatePossible | 0x0001 | -| * UpdateState | 0x0002 | -| * UpdateStateProgress | 0x0003 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -| * StateTransition | 0x0000 | -| * VersionApplied | 0x0001 | -| * DownloadError | 0x0002 | -\*----------------------------------------------------------------------------*/ - -/* - * Command AnnounceOtaProvider - */ -class OtaSoftwareUpdateRequestorAnnounceOtaProvider : public ModelCommand -{ -public: - OtaSoftwareUpdateRequestorAnnounceOtaProvider() : ModelCommand("announce-ota-provider") - { - AddArgument("ProviderNodeId", 0, UINT64_MAX, &mRequest.providerNodeId); - AddArgument("VendorId", 0, UINT16_MAX, &mRequest.vendorId); - AddArgument( - "AnnouncementReason", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.announcementReason)); - AddArgument("MetadataForNode", &mRequest.metadataForNode); - AddArgument("Endpoint", 0, UINT16_MAX, &mRequest.endpoint); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::OtaSoftwareUpdateRequestor::Commands::AnnounceOtaProvider::Type mRequest; -}; - -/* - * Event StateTransition - */ -class ReadOtaSoftwareUpdateRequestorStateTransition : public ModelCommand -{ -public: - ReadOtaSoftwareUpdateRequestorStateTransition() : ModelCommand("read-event") - { - AddArgument("event-name", "state-transition"); - ModelCommand::AddArguments(); - } - - ~ReadOtaSoftwareUpdateRequestorStateTransition() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReadEvent (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void OnEventResponse(void * context, - chip::app::Clusters::OtaSoftwareUpdateRequestor::Events::StateTransition::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "OtaSoftwareUpdateRequestor.StateTransition response", value); - } -}; - -class ReportOtaSoftwareUpdateRequestorStateTransition : public ModelCommand -{ -public: - ReportOtaSoftwareUpdateRequestorStateTransition() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "state-transition"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOtaSoftwareUpdateRequestorStateTransition() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReportEvent (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - chip::app::Clusters::OtaSoftwareUpdateRequestor::Events::StateTransition::DecodableType value) - { - DataModelLogger::LogValue("OtaSoftwareUpdateRequestor.StateTransition report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event VersionApplied - */ -class ReadOtaSoftwareUpdateRequestorVersionApplied : public ModelCommand -{ -public: - ReadOtaSoftwareUpdateRequestorVersionApplied() : ModelCommand("read-event") - { - AddArgument("event-name", "version-applied"); - ModelCommand::AddArguments(); - } - - ~ReadOtaSoftwareUpdateRequestorVersionApplied() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReadEvent (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void OnEventResponse(void * context, - chip::app::Clusters::OtaSoftwareUpdateRequestor::Events::VersionApplied::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "OtaSoftwareUpdateRequestor.VersionApplied response", value); - } -}; - -class ReportOtaSoftwareUpdateRequestorVersionApplied : public ModelCommand -{ -public: - ReportOtaSoftwareUpdateRequestorVersionApplied() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "version-applied"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOtaSoftwareUpdateRequestorVersionApplied() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReportEvent (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - chip::app::Clusters::OtaSoftwareUpdateRequestor::Events::VersionApplied::DecodableType value) - { - DataModelLogger::LogValue("OtaSoftwareUpdateRequestor.VersionApplied report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event DownloadError - */ -class ReadOtaSoftwareUpdateRequestorDownloadError : public ModelCommand -{ -public: - ReadOtaSoftwareUpdateRequestorDownloadError() : ModelCommand("read-event") - { - AddArgument("event-name", "download-error"); - ModelCommand::AddArguments(); - } - - ~ReadOtaSoftwareUpdateRequestorDownloadError() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReadEvent (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void OnEventResponse(void * context, - chip::app::Clusters::OtaSoftwareUpdateRequestor::Events::DownloadError::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "OtaSoftwareUpdateRequestor.DownloadError response", value); - } -}; - -class ReportOtaSoftwareUpdateRequestorDownloadError : public ModelCommand -{ -public: - ReportOtaSoftwareUpdateRequestorDownloadError() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "download-error"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOtaSoftwareUpdateRequestorDownloadError() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReportEvent (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - chip::app::Clusters::OtaSoftwareUpdateRequestor::Events::DownloadError::DecodableType value) - { - DataModelLogger::LogValue("OtaSoftwareUpdateRequestor.DownloadError report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute DefaultOtaProviders - */ -class ReadOtaSoftwareUpdateRequestorDefaultOtaProviders : public ModelCommand -{ -public: - ReadOtaSoftwareUpdateRequestorDefaultOtaProviders() : ModelCommand("read") - { - AddArgument("attr-name", "default-ota-providers"); - ModelCommand::AddArguments(); - } - - ~ReadOtaSoftwareUpdateRequestorDefaultOtaProviders() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void - OnAttributeResponse(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::OtaSoftwareUpdateRequestor::Structs::ProviderLocation::DecodableType> & value) - { - OnGeneralAttributeEventResponse(context, "OtaSoftwareUpdateRequestor.DefaultOtaProviders response", value); - } -}; - -class WriteOtaSoftwareUpdateRequestorDefaultOtaProviders : public ModelCommand -{ -public: - WriteOtaSoftwareUpdateRequestorDefaultOtaProviders() : ModelCommand("write"), mComplex(&mValue) - { - AddArgument("attr-name", "default-ota-providers"); - AddArgument("attr-value", &mComplex); - ModelCommand::AddArguments(); - } - - ~WriteOtaSoftwareUpdateRequestorDefaultOtaProviders() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) WriteAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::List mValue; - TypedComplexArgument< - chip::app::DataModel::List> - mComplex; -}; - -class ReportOtaSoftwareUpdateRequestorDefaultOtaProviders : public ModelCommand -{ -public: - ReportOtaSoftwareUpdateRequestorDefaultOtaProviders() : ModelCommand("subscribe") - { - AddArgument("attr-name", "default-ota-providers"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOtaSoftwareUpdateRequestorDefaultOtaProviders() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster - .SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void - OnValueReport(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::OtaSoftwareUpdateRequestor::Structs::ProviderLocation::DecodableType> & value) - { - DataModelLogger::LogValue("OtaSoftwareUpdateRequestor.DefaultOtaProviders report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute UpdatePossible - */ -class ReadOtaSoftwareUpdateRequestorUpdatePossible : public ModelCommand -{ -public: - ReadOtaSoftwareUpdateRequestorUpdatePossible() : ModelCommand("read") - { - AddArgument("attr-name", "update-possible"); - ModelCommand::AddArguments(); - } - - ~ReadOtaSoftwareUpdateRequestorUpdatePossible() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, bool value) - { - OnGeneralAttributeEventResponse(context, "OtaSoftwareUpdateRequestor.UpdatePossible response", value); - } -}; - -class ReportOtaSoftwareUpdateRequestorUpdatePossible : public ModelCommand -{ -public: - ReportOtaSoftwareUpdateRequestorUpdatePossible() : ModelCommand("subscribe") - { - AddArgument("attr-name", "update-possible"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOtaSoftwareUpdateRequestorUpdatePossible() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, bool value) - { - DataModelLogger::LogValue("OtaSoftwareUpdateRequestor.UpdatePossible report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute UpdateState - */ -class ReadOtaSoftwareUpdateRequestorUpdateState : public ModelCommand -{ -public: - ReadOtaSoftwareUpdateRequestorUpdateState() : ModelCommand("read") - { - AddArgument("attr-name", "update-state"); - ModelCommand::AddArguments(); - } - - ~ReadOtaSoftwareUpdateRequestorUpdateState() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::app::Clusters::OtaSoftwareUpdateRequestor::OTAUpdateStateEnum value) - { - OnGeneralAttributeEventResponse(context, "OtaSoftwareUpdateRequestor.UpdateState response", value); - } -}; - -class ReportOtaSoftwareUpdateRequestorUpdateState : public ModelCommand -{ -public: - ReportOtaSoftwareUpdateRequestorUpdateState() : ModelCommand("subscribe") - { - AddArgument("attr-name", "update-state"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOtaSoftwareUpdateRequestorUpdateState() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::OtaSoftwareUpdateRequestor::OTAUpdateStateEnum value) - { - DataModelLogger::LogValue("OtaSoftwareUpdateRequestor.UpdateState report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute UpdateStateProgress - */ -class ReadOtaSoftwareUpdateRequestorUpdateStateProgress : public ModelCommand -{ -public: - ReadOtaSoftwareUpdateRequestorUpdateStateProgress() : ModelCommand("read") - { - AddArgument("attr-name", "update-state-progress"); - ModelCommand::AddArguments(); - } - - ~ReadOtaSoftwareUpdateRequestorUpdateStateProgress() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "OtaSoftwareUpdateRequestor.UpdateStateProgress response", value); - } -}; - -class ReportOtaSoftwareUpdateRequestorUpdateStateProgress : public ModelCommand -{ -public: - ReportOtaSoftwareUpdateRequestorUpdateStateProgress() : ModelCommand("subscribe") - { - AddArgument("attr-name", "update-state-progress"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOtaSoftwareUpdateRequestorUpdateStateProgress() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster - .SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("OtaSoftwareUpdateRequestor.UpdateStateProgress report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadOtaSoftwareUpdateRequestorAttributeList : public ModelCommand -{ -public: - ReadOtaSoftwareUpdateRequestorAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadOtaSoftwareUpdateRequestorAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "OtaSoftwareUpdateRequestor.AttributeList response", value); - } -}; - -class ReportOtaSoftwareUpdateRequestorAttributeList : public ModelCommand -{ -public: - ReportOtaSoftwareUpdateRequestorAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOtaSoftwareUpdateRequestorAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("OtaSoftwareUpdateRequestor.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadOtaSoftwareUpdateRequestorClusterRevision : public ModelCommand -{ -public: - ReadOtaSoftwareUpdateRequestorClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadOtaSoftwareUpdateRequestorClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "OtaSoftwareUpdateRequestor.ClusterRevision response", value); - } -}; - -class ReportOtaSoftwareUpdateRequestorClusterRevision : public ModelCommand -{ -public: - ReportOtaSoftwareUpdateRequestorClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOtaSoftwareUpdateRequestorClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002A) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("OtaSoftwareUpdateRequestor.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster OccupancySensing | 0x0406 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * Occupancy | 0x0000 | -| * OccupancySensorType | 0x0001 | -| * OccupancySensorTypeBitmap | 0x0002 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Attribute Occupancy - */ -class ReadOccupancySensingOccupancy : public ModelCommand -{ -public: - ReadOccupancySensingOccupancy() : ModelCommand("read") - { - AddArgument("attr-name", "occupancy"); - ModelCommand::AddArguments(); - } - - ~ReadOccupancySensingOccupancy() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::OccupancySensingCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "OccupancySensing.Occupancy response", value); - } -}; - -class ReportOccupancySensingOccupancy : public ModelCommand -{ -public: - ReportOccupancySensingOccupancy() : ModelCommand("subscribe") - { - AddArgument("attr-name", "occupancy"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOccupancySensingOccupancy() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::OccupancySensingCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("OccupancySensing.Occupancy report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute OccupancySensorType - */ -class ReadOccupancySensingOccupancySensorType : public ModelCommand -{ -public: - ReadOccupancySensingOccupancySensorType() : ModelCommand("read") - { - AddArgument("attr-name", "occupancy-sensor-type"); - ModelCommand::AddArguments(); - } - - ~ReadOccupancySensingOccupancySensorType() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::OccupancySensingCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "OccupancySensing.OccupancySensorType response", value); - } -}; - -class ReportOccupancySensingOccupancySensorType : public ModelCommand -{ -public: - ReportOccupancySensingOccupancySensorType() : ModelCommand("subscribe") - { - AddArgument("attr-name", "occupancy-sensor-type"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOccupancySensingOccupancySensorType() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::OccupancySensingCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("OccupancySensing.OccupancySensorType report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute OccupancySensorTypeBitmap - */ -class ReadOccupancySensingOccupancySensorTypeBitmap : public ModelCommand -{ -public: - ReadOccupancySensingOccupancySensorTypeBitmap() : ModelCommand("read") - { - AddArgument("attr-name", "occupancy-sensor-type-bitmap"); - ModelCommand::AddArguments(); - } - - ~ReadOccupancySensingOccupancySensorTypeBitmap() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::OccupancySensingCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "OccupancySensing.OccupancySensorTypeBitmap response", value); - } -}; - -class ReportOccupancySensingOccupancySensorTypeBitmap : public ModelCommand -{ -public: - ReportOccupancySensingOccupancySensorTypeBitmap() : ModelCommand("subscribe") - { - AddArgument("attr-name", "occupancy-sensor-type-bitmap"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOccupancySensingOccupancySensorTypeBitmap() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::OccupancySensingCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("OccupancySensing.OccupancySensorTypeBitmap report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadOccupancySensingAttributeList : public ModelCommand -{ -public: - ReadOccupancySensingAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadOccupancySensingAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::OccupancySensingCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "OccupancySensing.AttributeList response", value); - } -}; - -class ReportOccupancySensingAttributeList : public ModelCommand -{ -public: - ReportOccupancySensingAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOccupancySensingAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::OccupancySensingCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("OccupancySensing.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadOccupancySensingClusterRevision : public ModelCommand -{ -public: - ReadOccupancySensingClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadOccupancySensingClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::OccupancySensingCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "OccupancySensing.ClusterRevision response", value); - } -}; - -class ReportOccupancySensingClusterRevision : public ModelCommand -{ -public: - ReportOccupancySensingClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOccupancySensingClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000406) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::OccupancySensingCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("OccupancySensing.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster OnOff | 0x0006 | -|------------------------------------------------------------------------------| -| Commands: | | -| * Off | 0x00 | -| * OffWithEffect | 0x40 | -| * On | 0x01 | -| * OnWithRecallGlobalScene | 0x41 | -| * OnWithTimedOff | 0x42 | -| * Toggle | 0x02 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * OnOff | 0x0000 | -| * GlobalSceneControl | 0x4000 | -| * OnTime | 0x4001 | -| * OffWaitTime | 0x4002 | -| * StartUpOnOff | 0x4003 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command Off - */ -class OnOffOff : public ModelCommand -{ -public: - OnOffOff() : ModelCommand("off") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::OnOff::Commands::Off::Type mRequest; -}; - -/* - * Command OffWithEffect - */ -class OnOffOffWithEffect : public ModelCommand -{ -public: - OnOffOffWithEffect() : ModelCommand("off-with-effect") - { - AddArgument("EffectId", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.effectId)); - AddArgument("EffectVariant", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.effectVariant)); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) command (0x00000040) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::OnOff::Commands::OffWithEffect::Type mRequest; -}; - -/* - * Command On - */ -class OnOffOn : public ModelCommand -{ -public: - OnOffOn() : ModelCommand("on") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) command (0x00000001) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::OnOff::Commands::On::Type mRequest; -}; - -/* - * Command OnWithRecallGlobalScene - */ -class OnOffOnWithRecallGlobalScene : public ModelCommand -{ -public: - OnOffOnWithRecallGlobalScene() : ModelCommand("on-with-recall-global-scene") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) command (0x00000041) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::OnOff::Commands::OnWithRecallGlobalScene::Type mRequest; -}; - -/* - * Command OnWithTimedOff - */ -class OnOffOnWithTimedOff : public ModelCommand -{ -public: - OnOffOnWithTimedOff() : ModelCommand("on-with-timed-off") - { - AddArgument("OnOffControl", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.onOffControl)); - AddArgument("OnTime", 0, UINT16_MAX, &mRequest.onTime); - AddArgument("OffWaitTime", 0, UINT16_MAX, &mRequest.offWaitTime); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) command (0x00000042) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type mRequest; -}; - -/* - * Command Toggle - */ -class OnOffToggle : public ModelCommand -{ -public: - OnOffToggle() : ModelCommand("toggle") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) command (0x00000002) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::OnOff::Commands::Toggle::Type mRequest; -}; - -/* - * Attribute OnOff - */ -class ReadOnOffOnOff : public ModelCommand -{ -public: - ReadOnOffOnOff() : ModelCommand("read") - { - AddArgument("attr-name", "on-off"); - ModelCommand::AddArguments(); - } - - ~ReadOnOffOnOff() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, bool value) - { - OnGeneralAttributeEventResponse(context, "OnOff.OnOff response", value); - } -}; - -class ReportOnOffOnOff : public ModelCommand -{ -public: - ReportOnOffOnOff() : ModelCommand("subscribe") - { - AddArgument("attr-name", "on-off"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOnOffOnOff() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, bool value) { DataModelLogger::LogValue("OnOff.OnOff report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute GlobalSceneControl - */ -class ReadOnOffGlobalSceneControl : public ModelCommand -{ -public: - ReadOnOffGlobalSceneControl() : ModelCommand("read") - { - AddArgument("attr-name", "global-scene-control"); - ModelCommand::AddArguments(); - } - - ~ReadOnOffGlobalSceneControl() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x00004000) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, bool value) - { - OnGeneralAttributeEventResponse(context, "OnOff.GlobalSceneControl response", value); - } -}; - -class ReportOnOffGlobalSceneControl : public ModelCommand -{ -public: - ReportOnOffGlobalSceneControl() : ModelCommand("subscribe") - { - AddArgument("attr-name", "global-scene-control"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOnOffGlobalSceneControl() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x00004000) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, bool value) - { - DataModelLogger::LogValue("OnOff.GlobalSceneControl report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute OnTime - */ -class ReadOnOffOnTime : public ModelCommand -{ -public: - ReadOnOffOnTime() : ModelCommand("read") - { - AddArgument("attr-name", "on-time"); - ModelCommand::AddArguments(); - } - - ~ReadOnOffOnTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x00004001) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "OnOff.OnTime response", value); - } -}; - -class WriteOnOffOnTime : public ModelCommand -{ -public: - WriteOnOffOnTime() : ModelCommand("write") - { - AddArgument("attr-name", "on-time"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteOnOffOnTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) WriteAttribute (0x00004001) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint16_t mValue; -}; - -class ReportOnOffOnTime : public ModelCommand -{ -public: - ReportOnOffOnTime() : ModelCommand("subscribe") - { - AddArgument("attr-name", "on-time"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOnOffOnTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x00004001) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) { DataModelLogger::LogValue("OnOff.OnTime report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute OffWaitTime - */ -class ReadOnOffOffWaitTime : public ModelCommand -{ -public: - ReadOnOffOffWaitTime() : ModelCommand("read") - { - AddArgument("attr-name", "off-wait-time"); - ModelCommand::AddArguments(); - } - - ~ReadOnOffOffWaitTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x00004002) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "OnOff.OffWaitTime response", value); - } -}; - -class WriteOnOffOffWaitTime : public ModelCommand -{ -public: - WriteOnOffOffWaitTime() : ModelCommand("write") - { - AddArgument("attr-name", "off-wait-time"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteOnOffOffWaitTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) WriteAttribute (0x00004002) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint16_t mValue; -}; - -class ReportOnOffOffWaitTime : public ModelCommand -{ -public: - ReportOnOffOffWaitTime() : ModelCommand("subscribe") - { - AddArgument("attr-name", "off-wait-time"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOnOffOffWaitTime() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x00004002) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) { DataModelLogger::LogValue("OnOff.OffWaitTime report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute StartUpOnOff - */ -class ReadOnOffStartUpOnOff : public ModelCommand -{ -public: - ReadOnOffStartUpOnOff() : ModelCommand("read") - { - AddArgument("attr-name", "start-up-on-off"); - ModelCommand::AddArguments(); - } - - ~ReadOnOffStartUpOnOff() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x00004003) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "OnOff.StartUpOnOff response", value); - } -}; - -class WriteOnOffStartUpOnOff : public ModelCommand -{ -public: - WriteOnOffStartUpOnOff() : ModelCommand("write") - { - AddArgument("attr-name", "start-up-on-off"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteOnOffStartUpOnOff() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) WriteAttribute (0x00004003) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint8_t mValue; -}; - -class ReportOnOffStartUpOnOff : public ModelCommand -{ -public: - ReportOnOffStartUpOnOff() : ModelCommand("subscribe") - { - AddArgument("attr-name", "start-up-on-off"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOnOffStartUpOnOff() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x00004003) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) { DataModelLogger::LogValue("OnOff.StartUpOnOff report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadOnOffAttributeList : public ModelCommand -{ -public: - ReadOnOffAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadOnOffAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "OnOff.AttributeList response", value); - } -}; - -class ReportOnOffAttributeList : public ModelCommand -{ -public: - ReportOnOffAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOnOffAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("OnOff.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute FeatureMap - */ -class ReadOnOffFeatureMap : public ModelCommand -{ -public: - ReadOnOffFeatureMap() : ModelCommand("read") - { - AddArgument("attr-name", "feature-map"); - ModelCommand::AddArguments(); - } - - ~ReadOnOffFeatureMap() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x0000FFFC) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint32_t value) - { - OnGeneralAttributeEventResponse(context, "OnOff.FeatureMap response", value); - } -}; - -class ReportOnOffFeatureMap : public ModelCommand -{ -public: - ReportOnOffFeatureMap() : ModelCommand("subscribe") - { - AddArgument("attr-name", "feature-map"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOnOffFeatureMap() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x0000FFFC) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint32_t value) { DataModelLogger::LogValue("OnOff.FeatureMap report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadOnOffClusterRevision : public ModelCommand -{ -public: - ReadOnOffClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadOnOffClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "OnOff.ClusterRevision response", value); - } -}; - -class ReportOnOffClusterRevision : public ModelCommand -{ -public: - ReportOnOffClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOnOffClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000006) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("OnOff.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster OnOffSwitchConfiguration | 0x0007 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * SwitchType | 0x0000 | -| * SwitchActions | 0x0010 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Attribute SwitchType - */ -class ReadOnOffSwitchConfigurationSwitchType : public ModelCommand -{ -public: - ReadOnOffSwitchConfigurationSwitchType() : ModelCommand("read") - { - AddArgument("attr-name", "switch-type"); - ModelCommand::AddArguments(); - } - - ~ReadOnOffSwitchConfigurationSwitchType() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffSwitchConfigurationCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "OnOffSwitchConfiguration.SwitchType response", value); - } -}; - -class ReportOnOffSwitchConfigurationSwitchType : public ModelCommand -{ -public: - ReportOnOffSwitchConfigurationSwitchType() : ModelCommand("subscribe") - { - AddArgument("attr-name", "switch-type"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOnOffSwitchConfigurationSwitchType() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffSwitchConfigurationCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("OnOffSwitchConfiguration.SwitchType report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute SwitchActions - */ -class ReadOnOffSwitchConfigurationSwitchActions : public ModelCommand -{ -public: - ReadOnOffSwitchConfigurationSwitchActions() : ModelCommand("read") - { - AddArgument("attr-name", "switch-actions"); - ModelCommand::AddArguments(); - } - - ~ReadOnOffSwitchConfigurationSwitchActions() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReadAttribute (0x00000010) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffSwitchConfigurationCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "OnOffSwitchConfiguration.SwitchActions response", value); - } -}; - -class WriteOnOffSwitchConfigurationSwitchActions : public ModelCommand -{ -public: - WriteOnOffSwitchConfigurationSwitchActions() : ModelCommand("write") - { - AddArgument("attr-name", "switch-actions"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteOnOffSwitchConfigurationSwitchActions() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000007) WriteAttribute (0x00000010) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffSwitchConfigurationCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint8_t mValue; -}; - -class ReportOnOffSwitchConfigurationSwitchActions : public ModelCommand -{ -public: - ReportOnOffSwitchConfigurationSwitchActions() : ModelCommand("subscribe") - { - AddArgument("attr-name", "switch-actions"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOnOffSwitchConfigurationSwitchActions() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReportAttribute (0x00000010) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffSwitchConfigurationCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("OnOffSwitchConfiguration.SwitchActions report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadOnOffSwitchConfigurationAttributeList : public ModelCommand -{ -public: - ReadOnOffSwitchConfigurationAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadOnOffSwitchConfigurationAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffSwitchConfigurationCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "OnOffSwitchConfiguration.AttributeList response", value); - } -}; - -class ReportOnOffSwitchConfigurationAttributeList : public ModelCommand -{ -public: - ReportOnOffSwitchConfigurationAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOnOffSwitchConfigurationAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffSwitchConfigurationCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("OnOffSwitchConfiguration.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadOnOffSwitchConfigurationClusterRevision : public ModelCommand -{ -public: - ReadOnOffSwitchConfigurationClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadOnOffSwitchConfigurationClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffSwitchConfigurationCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "OnOffSwitchConfiguration.ClusterRevision response", value); - } -}; - -class ReportOnOffSwitchConfigurationClusterRevision : public ModelCommand -{ -public: - ReportOnOffSwitchConfigurationClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOnOffSwitchConfigurationClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000007) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::OnOffSwitchConfigurationCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("OnOffSwitchConfiguration.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster OperationalCredentials | 0x003E | -|------------------------------------------------------------------------------| -| Commands: | | -| * AddNOC | 0x06 | -| * AddTrustedRootCertificate | 0x0B | -| * AttestationRequest | 0x00 | -| * CertificateChainRequest | 0x02 | -| * OpCSRRequest | 0x04 | -| * RemoveFabric | 0x0A | -| * RemoveTrustedRootCertificate | 0x0C | -| * UpdateFabricLabel | 0x09 | -| * UpdateNOC | 0x07 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * NOCs | 0x0000 | -| * FabricsList | 0x0001 | -| * SupportedFabrics | 0x0002 | -| * CommissionedFabrics | 0x0003 | -| * TrustedRootCertificates | 0x0004 | -| * CurrentFabricIndex | 0x0005 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command AddNOC - */ -class OperationalCredentialsAddNOC : public ModelCommand -{ -public: - OperationalCredentialsAddNOC() : ModelCommand("add-noc") - { - AddArgument("NOCValue", &mRequest.NOCValue); - AddArgument("ICACValue", &mRequest.ICACValue); - AddArgument("IPKValue", &mRequest.IPKValue); - AddArgument("CaseAdminNode", 0, UINT64_MAX, &mRequest.caseAdminNode); - AddArgument("AdminVendorId", 0, UINT16_MAX, &mRequest.adminVendorId); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x00000006) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnOperationalCredentialsNOCResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::OperationalCredentials::Commands::AddNOC::Type mRequest; -}; - -/* - * Command AddTrustedRootCertificate - */ -class OperationalCredentialsAddTrustedRootCertificate : public ModelCommand -{ -public: - OperationalCredentialsAddTrustedRootCertificate() : ModelCommand("add-trusted-root-certificate") - { - AddArgument("RootCertificate", &mRequest.rootCertificate); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x0000000B) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::OperationalCredentials::Commands::AddTrustedRootCertificate::Type mRequest; -}; - -/* - * Command AttestationRequest - */ -class OperationalCredentialsAttestationRequest : public ModelCommand -{ -public: - OperationalCredentialsAttestationRequest() : ModelCommand("attestation-request") - { - AddArgument("AttestationNonce", &mRequest.attestationNonce); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnOperationalCredentialsAttestationResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::OperationalCredentials::Commands::AttestationRequest::Type mRequest; -}; - -/* - * Command CertificateChainRequest - */ -class OperationalCredentialsCertificateChainRequest : public ModelCommand -{ -public: - OperationalCredentialsCertificateChainRequest() : ModelCommand("certificate-chain-request") - { - AddArgument("CertificateType", 0, UINT8_MAX, &mRequest.certificateType); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x00000002) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnOperationalCredentialsCertificateChainResponseSuccess, - OnDefaultFailure, endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::OperationalCredentials::Commands::CertificateChainRequest::Type mRequest; -}; - -/* - * Command OpCSRRequest - */ -class OperationalCredentialsOpCSRRequest : public ModelCommand -{ -public: - OperationalCredentialsOpCSRRequest() : ModelCommand("op-csrrequest") - { - AddArgument("CSRNonce", &mRequest.CSRNonce); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x00000004) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnOperationalCredentialsOpCSRResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::OperationalCredentials::Commands::OpCSRRequest::Type mRequest; -}; - -/* - * Command RemoveFabric - */ -class OperationalCredentialsRemoveFabric : public ModelCommand -{ -public: - OperationalCredentialsRemoveFabric() : ModelCommand("remove-fabric") - { - AddArgument("FabricIndex", 0, UINT8_MAX, &mRequest.fabricIndex); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x0000000A) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnOperationalCredentialsNOCResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type mRequest; -}; - -/* - * Command RemoveTrustedRootCertificate - */ -class OperationalCredentialsRemoveTrustedRootCertificate : public ModelCommand -{ -public: - OperationalCredentialsRemoveTrustedRootCertificate() : ModelCommand("remove-trusted-root-certificate") - { - AddArgument("TrustedRootIdentifier", &mRequest.trustedRootIdentifier); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x0000000C) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::OperationalCredentials::Commands::RemoveTrustedRootCertificate::Type mRequest; -}; - -/* - * Command UpdateFabricLabel - */ -class OperationalCredentialsUpdateFabricLabel : public ModelCommand -{ -public: - OperationalCredentialsUpdateFabricLabel() : ModelCommand("update-fabric-label") - { - AddArgument("Label", &mRequest.label); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x00000009) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnOperationalCredentialsNOCResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::OperationalCredentials::Commands::UpdateFabricLabel::Type mRequest; -}; - -/* - * Command UpdateNOC - */ -class OperationalCredentialsUpdateNOC : public ModelCommand -{ -public: - OperationalCredentialsUpdateNOC() : ModelCommand("update-noc") - { - AddArgument("NOCValue", &mRequest.NOCValue); - AddArgument("ICACValue", &mRequest.ICACValue); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) command (0x00000007) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnOperationalCredentialsNOCResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::OperationalCredentials::Commands::UpdateNOC::Type mRequest; -}; - -/* - * Attribute NOCs - */ -class ReadOperationalCredentialsNOCs : public ModelCommand -{ -public: - ReadOperationalCredentialsNOCs() : ModelCommand("read") - { - AddArgument("attr-name", "nocs"); - ModelCommand::AddArguments(); - } - - ~ReadOperationalCredentialsNOCs() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::OperationalCredentialsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse( - void * context, - const chip::app::DataModel::DecodableList & - value) - { - OnGeneralAttributeEventResponse(context, "OperationalCredentials.NOCs response", value); - } -}; - -/* - * Attribute FabricsList - */ -class ReadOperationalCredentialsFabricsList : public ModelCommand -{ -public: - ReadOperationalCredentialsFabricsList() : ModelCommand("read") - { - AddArgument("attr-name", "fabrics-list"); - ModelCommand::AddArguments(); - } - - ~ReadOperationalCredentialsFabricsList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::OperationalCredentialsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void - OnAttributeResponse(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & value) - { - OnGeneralAttributeEventResponse(context, "OperationalCredentials.FabricsList response", value); - } -}; - -class ReportOperationalCredentialsFabricsList : public ModelCommand -{ -public: - ReportOperationalCredentialsFabricsList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "fabrics-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOperationalCredentialsFabricsList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::OperationalCredentialsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & value) - { - DataModelLogger::LogValue("OperationalCredentials.FabricsList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute SupportedFabrics - */ -class ReadOperationalCredentialsSupportedFabrics : public ModelCommand -{ -public: - ReadOperationalCredentialsSupportedFabrics() : ModelCommand("read") - { - AddArgument("attr-name", "supported-fabrics"); - ModelCommand::AddArguments(); - } - - ~ReadOperationalCredentialsSupportedFabrics() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::OperationalCredentialsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "OperationalCredentials.SupportedFabrics response", value); - } -}; - -class ReportOperationalCredentialsSupportedFabrics : public ModelCommand -{ -public: - ReportOperationalCredentialsSupportedFabrics() : ModelCommand("subscribe") - { - AddArgument("attr-name", "supported-fabrics"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOperationalCredentialsSupportedFabrics() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::OperationalCredentialsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("OperationalCredentials.SupportedFabrics report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute CommissionedFabrics - */ -class ReadOperationalCredentialsCommissionedFabrics : public ModelCommand -{ -public: - ReadOperationalCredentialsCommissionedFabrics() : ModelCommand("read") - { - AddArgument("attr-name", "commissioned-fabrics"); - ModelCommand::AddArguments(); - } - - ~ReadOperationalCredentialsCommissionedFabrics() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::OperationalCredentialsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "OperationalCredentials.CommissionedFabrics response", value); - } -}; - -class ReportOperationalCredentialsCommissionedFabrics : public ModelCommand -{ -public: - ReportOperationalCredentialsCommissionedFabrics() : ModelCommand("subscribe") - { - AddArgument("attr-name", "commissioned-fabrics"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOperationalCredentialsCommissionedFabrics() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::OperationalCredentialsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("OperationalCredentials.CommissionedFabrics report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute TrustedRootCertificates - */ -class ReadOperationalCredentialsTrustedRootCertificates : public ModelCommand -{ -public: - ReadOperationalCredentialsTrustedRootCertificates() : ModelCommand("read") - { - AddArgument("attr-name", "trusted-root-certificates"); - ModelCommand::AddArguments(); - } - - ~ReadOperationalCredentialsTrustedRootCertificates() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::OperationalCredentialsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "OperationalCredentials.TrustedRootCertificates response", value); - } -}; - -class ReportOperationalCredentialsTrustedRootCertificates : public ModelCommand -{ -public: - ReportOperationalCredentialsTrustedRootCertificates() : ModelCommand("subscribe") - { - AddArgument("attr-name", "trusted-root-certificates"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOperationalCredentialsTrustedRootCertificates() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::OperationalCredentialsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster - .SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("OperationalCredentials.TrustedRootCertificates report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute CurrentFabricIndex - */ -class ReadOperationalCredentialsCurrentFabricIndex : public ModelCommand -{ -public: - ReadOperationalCredentialsCurrentFabricIndex() : ModelCommand("read") - { - AddArgument("attr-name", "current-fabric-index"); - ModelCommand::AddArguments(); - } - - ~ReadOperationalCredentialsCurrentFabricIndex() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::OperationalCredentialsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::FabricIndex value) - { - OnGeneralAttributeEventResponse(context, "OperationalCredentials.CurrentFabricIndex response", value); - } -}; - -class ReportOperationalCredentialsCurrentFabricIndex : public ModelCommand -{ -public: - ReportOperationalCredentialsCurrentFabricIndex() : ModelCommand("subscribe") - { - AddArgument("attr-name", "current-fabric-index"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOperationalCredentialsCurrentFabricIndex() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::OperationalCredentialsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::FabricIndex value) - { - DataModelLogger::LogValue("OperationalCredentials.CurrentFabricIndex report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadOperationalCredentialsAttributeList : public ModelCommand -{ -public: - ReadOperationalCredentialsAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadOperationalCredentialsAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::OperationalCredentialsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "OperationalCredentials.AttributeList response", value); - } -}; - -class ReportOperationalCredentialsAttributeList : public ModelCommand -{ -public: - ReportOperationalCredentialsAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOperationalCredentialsAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::OperationalCredentialsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("OperationalCredentials.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadOperationalCredentialsClusterRevision : public ModelCommand -{ -public: - ReadOperationalCredentialsClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadOperationalCredentialsClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::OperationalCredentialsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "OperationalCredentials.ClusterRevision response", value); - } -}; - -class ReportOperationalCredentialsClusterRevision : public ModelCommand -{ -public: - ReportOperationalCredentialsClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportOperationalCredentialsClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003E) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::OperationalCredentialsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("OperationalCredentials.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster PowerSource | 0x002F | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * Status | 0x0000 | -| * Order | 0x0001 | -| * Description | 0x0002 | -| * BatteryVoltage | 0x000B | -| * BatteryPercentRemaining | 0x000C | -| * BatteryTimeRemaining | 0x000D | -| * BatteryChargeLevel | 0x000E | -| * ActiveBatteryFaults | 0x0012 | -| * BatteryChargeState | 0x001A | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Attribute Status - */ -class ReadPowerSourceStatus : public ModelCommand -{ -public: - ReadPowerSourceStatus() : ModelCommand("read") - { - AddArgument("attr-name", "status"); - ModelCommand::AddArguments(); - } - - ~ReadPowerSourceStatus() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "PowerSource.Status response", value); - } -}; - -class ReportPowerSourceStatus : public ModelCommand -{ -public: - ReportPowerSourceStatus() : ModelCommand("subscribe") - { - AddArgument("attr-name", "status"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPowerSourceStatus() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) { DataModelLogger::LogValue("PowerSource.Status report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Order - */ -class ReadPowerSourceOrder : public ModelCommand -{ -public: - ReadPowerSourceOrder() : ModelCommand("read") - { - AddArgument("attr-name", "order"); - ModelCommand::AddArguments(); - } - - ~ReadPowerSourceOrder() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "PowerSource.Order response", value); - } -}; - -class ReportPowerSourceOrder : public ModelCommand -{ -public: - ReportPowerSourceOrder() : ModelCommand("subscribe") - { - AddArgument("attr-name", "order"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPowerSourceOrder() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) { DataModelLogger::LogValue("PowerSource.Order report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Description - */ -class ReadPowerSourceDescription : public ModelCommand -{ -public: - ReadPowerSourceDescription() : ModelCommand("read") - { - AddArgument("attr-name", "description"); - ModelCommand::AddArguments(); - } - - ~ReadPowerSourceDescription() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::CharSpan value) - { - OnGeneralAttributeEventResponse(context, "PowerSource.Description response", value); - } -}; - -class ReportPowerSourceDescription : public ModelCommand -{ -public: - ReportPowerSourceDescription() : ModelCommand("subscribe") - { - AddArgument("attr-name", "description"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPowerSourceDescription() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::CharSpan value) - { - DataModelLogger::LogValue("PowerSource.Description report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute BatteryVoltage - */ -class ReadPowerSourceBatteryVoltage : public ModelCommand -{ -public: - ReadPowerSourceBatteryVoltage() : ModelCommand("read") - { - AddArgument("attr-name", "battery-voltage"); - ModelCommand::AddArguments(); - } - - ~ReadPowerSourceBatteryVoltage() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000000B) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint32_t value) - { - OnGeneralAttributeEventResponse(context, "PowerSource.BatteryVoltage response", value); - } -}; - -class ReportPowerSourceBatteryVoltage : public ModelCommand -{ -public: - ReportPowerSourceBatteryVoltage() : ModelCommand("subscribe") - { - AddArgument("attr-name", "battery-voltage"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPowerSourceBatteryVoltage() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000000B) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint32_t value) - { - DataModelLogger::LogValue("PowerSource.BatteryVoltage report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute BatteryPercentRemaining - */ -class ReadPowerSourceBatteryPercentRemaining : public ModelCommand -{ -public: - ReadPowerSourceBatteryPercentRemaining() : ModelCommand("read") - { - AddArgument("attr-name", "battery-percent-remaining"); - ModelCommand::AddArguments(); - } - - ~ReadPowerSourceBatteryPercentRemaining() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000000C) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "PowerSource.BatteryPercentRemaining response", value); - } -}; - -class ReportPowerSourceBatteryPercentRemaining : public ModelCommand -{ -public: - ReportPowerSourceBatteryPercentRemaining() : ModelCommand("subscribe") - { - AddArgument("attr-name", "battery-percent-remaining"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPowerSourceBatteryPercentRemaining() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000000C) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("PowerSource.BatteryPercentRemaining report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute BatteryTimeRemaining - */ -class ReadPowerSourceBatteryTimeRemaining : public ModelCommand -{ -public: - ReadPowerSourceBatteryTimeRemaining() : ModelCommand("read") - { - AddArgument("attr-name", "battery-time-remaining"); - ModelCommand::AddArguments(); - } - - ~ReadPowerSourceBatteryTimeRemaining() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000000D) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint32_t value) - { - OnGeneralAttributeEventResponse(context, "PowerSource.BatteryTimeRemaining response", value); - } -}; - -class ReportPowerSourceBatteryTimeRemaining : public ModelCommand -{ -public: - ReportPowerSourceBatteryTimeRemaining() : ModelCommand("subscribe") - { - AddArgument("attr-name", "battery-time-remaining"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPowerSourceBatteryTimeRemaining() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000000D) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint32_t value) - { - DataModelLogger::LogValue("PowerSource.BatteryTimeRemaining report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute BatteryChargeLevel - */ -class ReadPowerSourceBatteryChargeLevel : public ModelCommand -{ -public: - ReadPowerSourceBatteryChargeLevel() : ModelCommand("read") - { - AddArgument("attr-name", "battery-charge-level"); - ModelCommand::AddArguments(); - } - - ~ReadPowerSourceBatteryChargeLevel() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000000E) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "PowerSource.BatteryChargeLevel response", value); - } -}; - -class ReportPowerSourceBatteryChargeLevel : public ModelCommand -{ -public: - ReportPowerSourceBatteryChargeLevel() : ModelCommand("subscribe") - { - AddArgument("attr-name", "battery-charge-level"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPowerSourceBatteryChargeLevel() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000000E) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("PowerSource.BatteryChargeLevel report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ActiveBatteryFaults - */ -class ReadPowerSourceActiveBatteryFaults : public ModelCommand -{ -public: - ReadPowerSourceActiveBatteryFaults() : ModelCommand("read") - { - AddArgument("attr-name", "active-battery-faults"); - ModelCommand::AddArguments(); - } - - ~ReadPowerSourceActiveBatteryFaults() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000012) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "PowerSource.ActiveBatteryFaults response", value); - } -}; - -class ReportPowerSourceActiveBatteryFaults : public ModelCommand -{ -public: - ReportPowerSourceActiveBatteryFaults() : ModelCommand("subscribe") - { - AddArgument("attr-name", "active-battery-faults"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPowerSourceActiveBatteryFaults() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000012) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("PowerSource.ActiveBatteryFaults report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute BatteryChargeState - */ -class ReadPowerSourceBatteryChargeState : public ModelCommand -{ -public: - ReadPowerSourceBatteryChargeState() : ModelCommand("read") - { - AddArgument("attr-name", "battery-charge-state"); - ModelCommand::AddArguments(); - } - - ~ReadPowerSourceBatteryChargeState() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000001A) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "PowerSource.BatteryChargeState response", value); - } -}; - -class ReportPowerSourceBatteryChargeState : public ModelCommand -{ -public: - ReportPowerSourceBatteryChargeState() : ModelCommand("subscribe") - { - AddArgument("attr-name", "battery-charge-state"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPowerSourceBatteryChargeState() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000001A) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("PowerSource.BatteryChargeState report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadPowerSourceAttributeList : public ModelCommand -{ -public: - ReadPowerSourceAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadPowerSourceAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "PowerSource.AttributeList response", value); - } -}; - -class ReportPowerSourceAttributeList : public ModelCommand -{ -public: - ReportPowerSourceAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPowerSourceAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("PowerSource.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute FeatureMap - */ -class ReadPowerSourceFeatureMap : public ModelCommand -{ -public: - ReadPowerSourceFeatureMap() : ModelCommand("read") - { - AddArgument("attr-name", "feature-map"); - ModelCommand::AddArguments(); - } - - ~ReadPowerSourceFeatureMap() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000FFFC) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint32_t value) - { - OnGeneralAttributeEventResponse(context, "PowerSource.FeatureMap response", value); - } -}; - -class ReportPowerSourceFeatureMap : public ModelCommand -{ -public: - ReportPowerSourceFeatureMap() : ModelCommand("subscribe") - { - AddArgument("attr-name", "feature-map"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPowerSourceFeatureMap() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000FFFC) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint32_t value) - { - DataModelLogger::LogValue("PowerSource.FeatureMap report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadPowerSourceClusterRevision : public ModelCommand -{ -public: - ReadPowerSourceClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadPowerSourceClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "PowerSource.ClusterRevision response", value); - } -}; - -class ReportPowerSourceClusterRevision : public ModelCommand -{ -public: - ReportPowerSourceClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPowerSourceClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("PowerSource.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster PowerSourceConfiguration | 0x002E | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * Sources | 0x0000 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Attribute Sources - */ -class ReadPowerSourceConfigurationSources : public ModelCommand -{ -public: - ReadPowerSourceConfigurationSources() : ModelCommand("read") - { - AddArgument("attr-name", "sources"); - ModelCommand::AddArguments(); - } - - ~ReadPowerSourceConfigurationSources() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceConfigurationCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "PowerSourceConfiguration.Sources response", value); - } -}; - -class ReportPowerSourceConfigurationSources : public ModelCommand -{ -public: - ReportPowerSourceConfigurationSources() : ModelCommand("subscribe") - { - AddArgument("attr-name", "sources"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPowerSourceConfigurationSources() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceConfigurationCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("PowerSourceConfiguration.Sources report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadPowerSourceConfigurationAttributeList : public ModelCommand -{ -public: - ReadPowerSourceConfigurationAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadPowerSourceConfigurationAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceConfigurationCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "PowerSourceConfiguration.AttributeList response", value); - } -}; - -class ReportPowerSourceConfigurationAttributeList : public ModelCommand -{ -public: - ReportPowerSourceConfigurationAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPowerSourceConfigurationAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceConfigurationCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("PowerSourceConfiguration.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadPowerSourceConfigurationClusterRevision : public ModelCommand -{ -public: - ReadPowerSourceConfigurationClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadPowerSourceConfigurationClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceConfigurationCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "PowerSourceConfiguration.ClusterRevision response", value); - } -}; - -class ReportPowerSourceConfigurationClusterRevision : public ModelCommand -{ -public: - ReportPowerSourceConfigurationClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPowerSourceConfigurationClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000002E) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::PowerSourceConfigurationCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("PowerSourceConfiguration.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster PressureMeasurement | 0x0403 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * MeasuredValue | 0x0000 | -| * MinMeasuredValue | 0x0001 | -| * MaxMeasuredValue | 0x0002 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Attribute MeasuredValue - */ -class ReadPressureMeasurementMeasuredValue : public ModelCommand -{ -public: - ReadPressureMeasurementMeasuredValue() : ModelCommand("read") - { - AddArgument("attr-name", "measured-value"); - ModelCommand::AddArguments(); - } - - ~ReadPressureMeasurementMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::PressureMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "PressureMeasurement.MeasuredValue response", value); - } -}; - -class ReportPressureMeasurementMeasuredValue : public ModelCommand -{ -public: - ReportPressureMeasurementMeasuredValue() : ModelCommand("subscribe") - { - AddArgument("attr-name", "measured-value"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPressureMeasurementMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::PressureMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("PressureMeasurement.MeasuredValue report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MinMeasuredValue - */ -class ReadPressureMeasurementMinMeasuredValue : public ModelCommand -{ -public: - ReadPressureMeasurementMinMeasuredValue() : ModelCommand("read") - { - AddArgument("attr-name", "min-measured-value"); - ModelCommand::AddArguments(); - } - - ~ReadPressureMeasurementMinMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::PressureMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "PressureMeasurement.MinMeasuredValue response", value); - } -}; - -class ReportPressureMeasurementMinMeasuredValue : public ModelCommand -{ -public: - ReportPressureMeasurementMinMeasuredValue() : ModelCommand("subscribe") - { - AddArgument("attr-name", "min-measured-value"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPressureMeasurementMinMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::PressureMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("PressureMeasurement.MinMeasuredValue report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MaxMeasuredValue - */ -class ReadPressureMeasurementMaxMeasuredValue : public ModelCommand -{ -public: - ReadPressureMeasurementMaxMeasuredValue() : ModelCommand("read") - { - AddArgument("attr-name", "max-measured-value"); - ModelCommand::AddArguments(); - } - - ~ReadPressureMeasurementMaxMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::PressureMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "PressureMeasurement.MaxMeasuredValue response", value); - } -}; - -class ReportPressureMeasurementMaxMeasuredValue : public ModelCommand -{ -public: - ReportPressureMeasurementMaxMeasuredValue() : ModelCommand("subscribe") - { - AddArgument("attr-name", "max-measured-value"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPressureMeasurementMaxMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::PressureMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("PressureMeasurement.MaxMeasuredValue report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadPressureMeasurementAttributeList : public ModelCommand -{ -public: - ReadPressureMeasurementAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadPressureMeasurementAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::PressureMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "PressureMeasurement.AttributeList response", value); - } -}; - -class ReportPressureMeasurementAttributeList : public ModelCommand -{ -public: - ReportPressureMeasurementAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPressureMeasurementAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::PressureMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("PressureMeasurement.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadPressureMeasurementClusterRevision : public ModelCommand -{ -public: - ReadPressureMeasurementClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadPressureMeasurementClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::PressureMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "PressureMeasurement.ClusterRevision response", value); - } -}; - -class ReportPressureMeasurementClusterRevision : public ModelCommand -{ -public: - ReportPressureMeasurementClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPressureMeasurementClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000403) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::PressureMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("PressureMeasurement.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster PumpConfigurationAndControl | 0x0200 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * MaxPressure | 0x0000 | -| * MaxSpeed | 0x0001 | -| * MaxFlow | 0x0002 | -| * MinConstPressure | 0x0003 | -| * MaxConstPressure | 0x0004 | -| * MinCompPressure | 0x0005 | -| * MaxCompPressure | 0x0006 | -| * MinConstSpeed | 0x0007 | -| * MaxConstSpeed | 0x0008 | -| * MinConstFlow | 0x0009 | -| * MaxConstFlow | 0x000A | -| * MinConstTemp | 0x000B | -| * MaxConstTemp | 0x000C | -| * PumpStatus | 0x0010 | -| * EffectiveOperationMode | 0x0011 | -| * EffectiveControlMode | 0x0012 | -| * Capacity | 0x0013 | -| * Speed | 0x0014 | -| * LifetimeRunningHours | 0x0015 | -| * Power | 0x0016 | -| * LifetimeEnergyConsumed | 0x0017 | -| * OperationMode | 0x0020 | -| * ControlMode | 0x0021 | -| * AlarmMask | 0x0022 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -| * SupplyVoltageLow | 0x0000 | -| * SupplyVoltageHigh | 0x0001 | -| * PowerMissingPhase | 0x0002 | -| * SystemPressureLow | 0x0003 | -| * SystemPressureHigh | 0x0004 | -| * DryRunning | 0x0005 | -| * MotorTemperatureHigh | 0x0006 | -| * PumpMotorFatalFailure | 0x0007 | -| * ElectronicTemperatureHigh | 0x0008 | -| * PumpBlocked | 0x0009 | -| * SensorFailure | 0x000A | -| * ElectronicNonFatalFailure | 0x000B | -| * ElectronicFatalFailure | 0x000C | -| * GeneralFault | 0x000D | -| * Leakage | 0x000E | -| * AirDetection | 0x000F | -| * TurbineOperation | 0x0010 | -\*----------------------------------------------------------------------------*/ - -/* - * Event SupplyVoltageLow - */ -class ReadPumpConfigurationAndControlSupplyVoltageLow : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlSupplyVoltageLow() : ModelCommand("read-event") - { - AddArgument("event-name", "supply-voltage-low"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlSupplyVoltageLow() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadEvent (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void OnEventResponse(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::SupplyVoltageLow::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.SupplyVoltageLow response", value); - } -}; - -class ReportPumpConfigurationAndControlSupplyVoltageLow : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlSupplyVoltageLow() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "supply-voltage-low"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlSupplyVoltageLow() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportEvent (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::SupplyVoltageLow::DecodableType value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.SupplyVoltageLow report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event SupplyVoltageHigh - */ -class ReadPumpConfigurationAndControlSupplyVoltageHigh : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlSupplyVoltageHigh() : ModelCommand("read-event") - { - AddArgument("event-name", "supply-voltage-high"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlSupplyVoltageHigh() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadEvent (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void OnEventResponse(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::SupplyVoltageHigh::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.SupplyVoltageHigh response", value); - } -}; - -class ReportPumpConfigurationAndControlSupplyVoltageHigh : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlSupplyVoltageHigh() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "supply-voltage-high"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlSupplyVoltageHigh() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportEvent (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::SupplyVoltageHigh::DecodableType value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.SupplyVoltageHigh report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event PowerMissingPhase - */ -class ReadPumpConfigurationAndControlPowerMissingPhase : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlPowerMissingPhase() : ModelCommand("read-event") - { - AddArgument("event-name", "power-missing-phase"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlPowerMissingPhase() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadEvent (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void OnEventResponse(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::PowerMissingPhase::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.PowerMissingPhase response", value); - } -}; - -class ReportPumpConfigurationAndControlPowerMissingPhase : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlPowerMissingPhase() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "power-missing-phase"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlPowerMissingPhase() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportEvent (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::PowerMissingPhase::DecodableType value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.PowerMissingPhase report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event SystemPressureLow - */ -class ReadPumpConfigurationAndControlSystemPressureLow : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlSystemPressureLow() : ModelCommand("read-event") - { - AddArgument("event-name", "system-pressure-low"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlSystemPressureLow() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadEvent (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void OnEventResponse(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::SystemPressureLow::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.SystemPressureLow response", value); - } -}; - -class ReportPumpConfigurationAndControlSystemPressureLow : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlSystemPressureLow() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "system-pressure-low"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlSystemPressureLow() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportEvent (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::SystemPressureLow::DecodableType value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.SystemPressureLow report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event SystemPressureHigh - */ -class ReadPumpConfigurationAndControlSystemPressureHigh : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlSystemPressureHigh() : ModelCommand("read-event") - { - AddArgument("event-name", "system-pressure-high"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlSystemPressureHigh() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadEvent (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void OnEventResponse(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::SystemPressureHigh::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.SystemPressureHigh response", value); - } -}; - -class ReportPumpConfigurationAndControlSystemPressureHigh : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlSystemPressureHigh() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "system-pressure-high"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlSystemPressureHigh() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportEvent (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::SystemPressureHigh::DecodableType value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.SystemPressureHigh report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event DryRunning - */ -class ReadPumpConfigurationAndControlDryRunning : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlDryRunning() : ModelCommand("read-event") - { - AddArgument("event-name", "dry-running"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlDryRunning() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadEvent (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void OnEventResponse(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::DryRunning::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.DryRunning response", value); - } -}; - -class ReportPumpConfigurationAndControlDryRunning : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlDryRunning() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "dry-running"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlDryRunning() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportEvent (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::DryRunning::DecodableType value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.DryRunning report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event MotorTemperatureHigh - */ -class ReadPumpConfigurationAndControlMotorTemperatureHigh : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlMotorTemperatureHigh() : ModelCommand("read-event") - { - AddArgument("event-name", "motor-temperature-high"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlMotorTemperatureHigh() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadEvent (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void OnEventResponse(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::MotorTemperatureHigh::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.MotorTemperatureHigh response", value); - } -}; - -class ReportPumpConfigurationAndControlMotorTemperatureHigh : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlMotorTemperatureHigh() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "motor-temperature-high"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlMotorTemperatureHigh() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportEvent (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster - .SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::MotorTemperatureHigh::DecodableType value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.MotorTemperatureHigh report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event PumpMotorFatalFailure - */ -class ReadPumpConfigurationAndControlPumpMotorFatalFailure : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlPumpMotorFatalFailure() : ModelCommand("read-event") - { - AddArgument("event-name", "pump-motor-fatal-failure"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlPumpMotorFatalFailure() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadEvent (0x00000007) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void - OnEventResponse(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::PumpMotorFatalFailure::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.PumpMotorFatalFailure response", value); - } -}; - -class ReportPumpConfigurationAndControlPumpMotorFatalFailure : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlPumpMotorFatalFailure() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "pump-motor-fatal-failure"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlPumpMotorFatalFailure() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportEvent (0x00000007) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster - .SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::PumpMotorFatalFailure::DecodableType value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.PumpMotorFatalFailure report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event ElectronicTemperatureHigh - */ -class ReadPumpConfigurationAndControlElectronicTemperatureHigh : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlElectronicTemperatureHigh() : ModelCommand("read-event") - { - AddArgument("event-name", "electronic-temperature-high"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlElectronicTemperatureHigh() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadEvent (0x00000008) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster - .ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void - OnEventResponse(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::ElectronicTemperatureHigh::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.ElectronicTemperatureHigh response", value); - } -}; - -class ReportPumpConfigurationAndControlElectronicTemperatureHigh : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlElectronicTemperatureHigh() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "electronic-temperature-high"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlElectronicTemperatureHigh() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportEvent (0x00000008) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster - .SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void - OnValueReport(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::ElectronicTemperatureHigh::DecodableType value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.ElectronicTemperatureHigh report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event PumpBlocked - */ -class ReadPumpConfigurationAndControlPumpBlocked : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlPumpBlocked() : ModelCommand("read-event") - { - AddArgument("event-name", "pump-blocked"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlPumpBlocked() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadEvent (0x00000009) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void OnEventResponse(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::PumpBlocked::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.PumpBlocked response", value); - } -}; - -class ReportPumpConfigurationAndControlPumpBlocked : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlPumpBlocked() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "pump-blocked"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlPumpBlocked() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportEvent (0x00000009) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::PumpBlocked::DecodableType value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.PumpBlocked report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event SensorFailure - */ -class ReadPumpConfigurationAndControlSensorFailure : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlSensorFailure() : ModelCommand("read-event") - { - AddArgument("event-name", "sensor-failure"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlSensorFailure() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadEvent (0x0000000A) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void OnEventResponse(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::SensorFailure::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.SensorFailure response", value); - } -}; - -class ReportPumpConfigurationAndControlSensorFailure : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlSensorFailure() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "sensor-failure"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlSensorFailure() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportEvent (0x0000000A) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::SensorFailure::DecodableType value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.SensorFailure report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event ElectronicNonFatalFailure - */ -class ReadPumpConfigurationAndControlElectronicNonFatalFailure : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlElectronicNonFatalFailure() : ModelCommand("read-event") - { - AddArgument("event-name", "electronic-non-fatal-failure"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlElectronicNonFatalFailure() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadEvent (0x0000000B) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster - .ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void - OnEventResponse(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::ElectronicNonFatalFailure::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.ElectronicNonFatalFailure response", value); - } -}; - -class ReportPumpConfigurationAndControlElectronicNonFatalFailure : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlElectronicNonFatalFailure() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "electronic-non-fatal-failure"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlElectronicNonFatalFailure() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportEvent (0x0000000B) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster - .SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void - OnValueReport(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::ElectronicNonFatalFailure::DecodableType value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.ElectronicNonFatalFailure report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event ElectronicFatalFailure - */ -class ReadPumpConfigurationAndControlElectronicFatalFailure : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlElectronicFatalFailure() : ModelCommand("read-event") - { - AddArgument("event-name", "electronic-fatal-failure"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlElectronicFatalFailure() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadEvent (0x0000000C) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void - OnEventResponse(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::ElectronicFatalFailure::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.ElectronicFatalFailure response", value); - } -}; - -class ReportPumpConfigurationAndControlElectronicFatalFailure : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlElectronicFatalFailure() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "electronic-fatal-failure"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlElectronicFatalFailure() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportEvent (0x0000000C) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster - .SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::ElectronicFatalFailure::DecodableType value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.ElectronicFatalFailure report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event GeneralFault - */ -class ReadPumpConfigurationAndControlGeneralFault : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlGeneralFault() : ModelCommand("read-event") - { - AddArgument("event-name", "general-fault"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlGeneralFault() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadEvent (0x0000000D) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void OnEventResponse(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::GeneralFault::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.GeneralFault response", value); - } -}; - -class ReportPumpConfigurationAndControlGeneralFault : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlGeneralFault() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "general-fault"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlGeneralFault() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportEvent (0x0000000D) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::GeneralFault::DecodableType value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.GeneralFault report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event Leakage - */ -class ReadPumpConfigurationAndControlLeakage : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlLeakage() : ModelCommand("read-event") - { - AddArgument("event-name", "leakage"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlLeakage() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadEvent (0x0000000E) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void OnEventResponse(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::Leakage::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.Leakage response", value); - } -}; - -class ReportPumpConfigurationAndControlLeakage : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlLeakage() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "leakage"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlLeakage() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportEvent (0x0000000E) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::Leakage::DecodableType value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.Leakage report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event AirDetection - */ -class ReadPumpConfigurationAndControlAirDetection : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlAirDetection() : ModelCommand("read-event") - { - AddArgument("event-name", "air-detection"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlAirDetection() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadEvent (0x0000000F) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void OnEventResponse(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::AirDetection::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.AirDetection response", value); - } -}; - -class ReportPumpConfigurationAndControlAirDetection : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlAirDetection() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "air-detection"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlAirDetection() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportEvent (0x0000000F) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::AirDetection::DecodableType value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.AirDetection report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event TurbineOperation - */ -class ReadPumpConfigurationAndControlTurbineOperation : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlTurbineOperation() : ModelCommand("read-event") - { - AddArgument("event-name", "turbine-operation"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlTurbineOperation() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadEvent (0x00000010) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void OnEventResponse(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::TurbineOperation::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.TurbineOperation response", value); - } -}; - -class ReportPumpConfigurationAndControlTurbineOperation : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlTurbineOperation() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "turbine-operation"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlTurbineOperation() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportEvent (0x00000010) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - chip::app::Clusters::PumpConfigurationAndControl::Events::TurbineOperation::DecodableType value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.TurbineOperation report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MaxPressure - */ -class ReadPumpConfigurationAndControlMaxPressure : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlMaxPressure() : ModelCommand("read") - { - AddArgument("attr-name", "max-pressure"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlMaxPressure() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.MaxPressure response", value); - } -}; - -class ReportPumpConfigurationAndControlMaxPressure : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlMaxPressure() : ModelCommand("subscribe") - { - AddArgument("attr-name", "max-pressure"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlMaxPressure() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.MaxPressure report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MaxSpeed - */ -class ReadPumpConfigurationAndControlMaxSpeed : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlMaxSpeed() : ModelCommand("read") - { - AddArgument("attr-name", "max-speed"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlMaxSpeed() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.MaxSpeed response", value); - } -}; - -class ReportPumpConfigurationAndControlMaxSpeed : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlMaxSpeed() : ModelCommand("subscribe") - { - AddArgument("attr-name", "max-speed"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlMaxSpeed() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.MaxSpeed report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MaxFlow - */ -class ReadPumpConfigurationAndControlMaxFlow : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlMaxFlow() : ModelCommand("read") - { - AddArgument("attr-name", "max-flow"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlMaxFlow() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.MaxFlow response", value); - } -}; - -class ReportPumpConfigurationAndControlMaxFlow : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlMaxFlow() : ModelCommand("subscribe") - { - AddArgument("attr-name", "max-flow"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlMaxFlow() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.MaxFlow report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MinConstPressure - */ -class ReadPumpConfigurationAndControlMinConstPressure : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlMinConstPressure() : ModelCommand("read") - { - AddArgument("attr-name", "min-const-pressure"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlMinConstPressure() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.MinConstPressure response", value); - } -}; - -class ReportPumpConfigurationAndControlMinConstPressure : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlMinConstPressure() : ModelCommand("subscribe") - { - AddArgument("attr-name", "min-const-pressure"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlMinConstPressure() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.MinConstPressure report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MaxConstPressure - */ -class ReadPumpConfigurationAndControlMaxConstPressure : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlMaxConstPressure() : ModelCommand("read") - { - AddArgument("attr-name", "max-const-pressure"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlMaxConstPressure() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.MaxConstPressure response", value); - } -}; - -class ReportPumpConfigurationAndControlMaxConstPressure : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlMaxConstPressure() : ModelCommand("subscribe") - { - AddArgument("attr-name", "max-const-pressure"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlMaxConstPressure() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.MaxConstPressure report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MinCompPressure - */ -class ReadPumpConfigurationAndControlMinCompPressure : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlMinCompPressure() : ModelCommand("read") - { - AddArgument("attr-name", "min-comp-pressure"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlMinCompPressure() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.MinCompPressure response", value); - } -}; - -class ReportPumpConfigurationAndControlMinCompPressure : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlMinCompPressure() : ModelCommand("subscribe") - { - AddArgument("attr-name", "min-comp-pressure"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlMinCompPressure() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.MinCompPressure report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MaxCompPressure - */ -class ReadPumpConfigurationAndControlMaxCompPressure : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlMaxCompPressure() : ModelCommand("read") - { - AddArgument("attr-name", "max-comp-pressure"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlMaxCompPressure() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.MaxCompPressure response", value); - } -}; - -class ReportPumpConfigurationAndControlMaxCompPressure : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlMaxCompPressure() : ModelCommand("subscribe") - { - AddArgument("attr-name", "max-comp-pressure"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlMaxCompPressure() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.MaxCompPressure report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MinConstSpeed - */ -class ReadPumpConfigurationAndControlMinConstSpeed : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlMinConstSpeed() : ModelCommand("read") - { - AddArgument("attr-name", "min-const-speed"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlMinConstSpeed() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000007) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.MinConstSpeed response", value); - } -}; - -class ReportPumpConfigurationAndControlMinConstSpeed : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlMinConstSpeed() : ModelCommand("subscribe") - { - AddArgument("attr-name", "min-const-speed"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlMinConstSpeed() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000007) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.MinConstSpeed report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MaxConstSpeed - */ -class ReadPumpConfigurationAndControlMaxConstSpeed : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlMaxConstSpeed() : ModelCommand("read") - { - AddArgument("attr-name", "max-const-speed"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlMaxConstSpeed() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000008) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.MaxConstSpeed response", value); - } -}; - -class ReportPumpConfigurationAndControlMaxConstSpeed : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlMaxConstSpeed() : ModelCommand("subscribe") - { - AddArgument("attr-name", "max-const-speed"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlMaxConstSpeed() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000008) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.MaxConstSpeed report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MinConstFlow - */ -class ReadPumpConfigurationAndControlMinConstFlow : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlMinConstFlow() : ModelCommand("read") - { - AddArgument("attr-name", "min-const-flow"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlMinConstFlow() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000009) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.MinConstFlow response", value); - } -}; - -class ReportPumpConfigurationAndControlMinConstFlow : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlMinConstFlow() : ModelCommand("subscribe") - { - AddArgument("attr-name", "min-const-flow"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlMinConstFlow() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000009) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.MinConstFlow report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MaxConstFlow - */ -class ReadPumpConfigurationAndControlMaxConstFlow : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlMaxConstFlow() : ModelCommand("read") - { - AddArgument("attr-name", "max-const-flow"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlMaxConstFlow() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x0000000A) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.MaxConstFlow response", value); - } -}; - -class ReportPumpConfigurationAndControlMaxConstFlow : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlMaxConstFlow() : ModelCommand("subscribe") - { - AddArgument("attr-name", "max-const-flow"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlMaxConstFlow() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x0000000A) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.MaxConstFlow report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MinConstTemp - */ -class ReadPumpConfigurationAndControlMinConstTemp : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlMinConstTemp() : ModelCommand("read") - { - AddArgument("attr-name", "min-const-temp"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlMinConstTemp() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x0000000B) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.MinConstTemp response", value); - } -}; - -class ReportPumpConfigurationAndControlMinConstTemp : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlMinConstTemp() : ModelCommand("subscribe") - { - AddArgument("attr-name", "min-const-temp"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlMinConstTemp() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x0000000B) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.MinConstTemp report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MaxConstTemp - */ -class ReadPumpConfigurationAndControlMaxConstTemp : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlMaxConstTemp() : ModelCommand("read") - { - AddArgument("attr-name", "max-const-temp"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlMaxConstTemp() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x0000000C) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.MaxConstTemp response", value); - } -}; - -class ReportPumpConfigurationAndControlMaxConstTemp : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlMaxConstTemp() : ModelCommand("subscribe") - { - AddArgument("attr-name", "max-const-temp"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlMaxConstTemp() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x0000000C) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.MaxConstTemp report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute PumpStatus - */ -class ReadPumpConfigurationAndControlPumpStatus : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlPumpStatus() : ModelCommand("read") - { - AddArgument("attr-name", "pump-status"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlPumpStatus() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000010) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.PumpStatus response", value); - } -}; - -class ReportPumpConfigurationAndControlPumpStatus : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlPumpStatus() : ModelCommand("subscribe") - { - AddArgument("attr-name", "pump-status"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlPumpStatus() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000010) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.PumpStatus report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute EffectiveOperationMode - */ -class ReadPumpConfigurationAndControlEffectiveOperationMode : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlEffectiveOperationMode() : ModelCommand("read") - { - AddArgument("attr-name", "effective-operation-mode"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlEffectiveOperationMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000011) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster - .ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.EffectiveOperationMode response", value); - } -}; - -class ReportPumpConfigurationAndControlEffectiveOperationMode : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlEffectiveOperationMode() : ModelCommand("subscribe") - { - AddArgument("attr-name", "effective-operation-mode"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlEffectiveOperationMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000011) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster - .SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.EffectiveOperationMode report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute EffectiveControlMode - */ -class ReadPumpConfigurationAndControlEffectiveControlMode : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlEffectiveControlMode() : ModelCommand("read") - { - AddArgument("attr-name", "effective-control-mode"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlEffectiveControlMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000012) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.EffectiveControlMode response", value); - } -}; - -class ReportPumpConfigurationAndControlEffectiveControlMode : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlEffectiveControlMode() : ModelCommand("subscribe") - { - AddArgument("attr-name", "effective-control-mode"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlEffectiveControlMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000012) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster - .SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.EffectiveControlMode report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Capacity - */ -class ReadPumpConfigurationAndControlCapacity : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlCapacity() : ModelCommand("read") - { - AddArgument("attr-name", "capacity"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlCapacity() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000013) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.Capacity response", value); - } -}; - -class ReportPumpConfigurationAndControlCapacity : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlCapacity() : ModelCommand("subscribe") - { - AddArgument("attr-name", "capacity"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlCapacity() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000013) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.Capacity report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Speed - */ -class ReadPumpConfigurationAndControlSpeed : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlSpeed() : ModelCommand("read") - { - AddArgument("attr-name", "speed"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlSpeed() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000014) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.Speed response", value); - } -}; - -class ReportPumpConfigurationAndControlSpeed : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlSpeed() : ModelCommand("subscribe") - { - AddArgument("attr-name", "speed"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlSpeed() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000014) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.Speed report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute LifetimeRunningHours - */ -class ReadPumpConfigurationAndControlLifetimeRunningHours : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlLifetimeRunningHours() : ModelCommand("read") - { - AddArgument("attr-name", "lifetime-running-hours"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlLifetimeRunningHours() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000015) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.LifetimeRunningHours response", value); - } -}; - -class WritePumpConfigurationAndControlLifetimeRunningHours : public ModelCommand -{ -public: - WritePumpConfigurationAndControlLifetimeRunningHours() : ModelCommand("write") - { - AddArgument("attr-name", "lifetime-running-hours"); - AddArgument("attr-value", 0, UINT32_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WritePumpConfigurationAndControlLifetimeRunningHours() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) WriteAttribute (0x00000015) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportPumpConfigurationAndControlLifetimeRunningHours : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlLifetimeRunningHours() : ModelCommand("subscribe") - { - AddArgument("attr-name", "lifetime-running-hours"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlLifetimeRunningHours() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000015) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster - .SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.LifetimeRunningHours report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Power - */ -class ReadPumpConfigurationAndControlPower : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlPower() : ModelCommand("read") - { - AddArgument("attr-name", "power"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlPower() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000016) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint32_t value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.Power response", value); - } -}; - -class ReportPumpConfigurationAndControlPower : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlPower() : ModelCommand("subscribe") - { - AddArgument("attr-name", "power"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlPower() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000016) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint32_t value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.Power report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute LifetimeEnergyConsumed - */ -class ReadPumpConfigurationAndControlLifetimeEnergyConsumed : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlLifetimeEnergyConsumed() : ModelCommand("read") - { - AddArgument("attr-name", "lifetime-energy-consumed"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlLifetimeEnergyConsumed() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000017) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster - .ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.LifetimeEnergyConsumed response", value); - } -}; - -class WritePumpConfigurationAndControlLifetimeEnergyConsumed : public ModelCommand -{ -public: - WritePumpConfigurationAndControlLifetimeEnergyConsumed() : ModelCommand("write") - { - AddArgument("attr-name", "lifetime-energy-consumed"); - AddArgument("attr-value", 0, UINT32_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WritePumpConfigurationAndControlLifetimeEnergyConsumed() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) WriteAttribute (0x00000017) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster - .WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportPumpConfigurationAndControlLifetimeEnergyConsumed : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlLifetimeEnergyConsumed() : ModelCommand("subscribe") - { - AddArgument("attr-name", "lifetime-energy-consumed"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlLifetimeEnergyConsumed() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000017) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster - .SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.LifetimeEnergyConsumed report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute OperationMode - */ -class ReadPumpConfigurationAndControlOperationMode : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlOperationMode() : ModelCommand("read") - { - AddArgument("attr-name", "operation-mode"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlOperationMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000020) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.OperationMode response", value); - } -}; - -class WritePumpConfigurationAndControlOperationMode : public ModelCommand -{ -public: - WritePumpConfigurationAndControlOperationMode() : ModelCommand("write") - { - AddArgument("attr-name", "operation-mode"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WritePumpConfigurationAndControlOperationMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) WriteAttribute (0x00000020) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint8_t mValue; -}; - -class ReportPumpConfigurationAndControlOperationMode : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlOperationMode() : ModelCommand("subscribe") - { - AddArgument("attr-name", "operation-mode"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlOperationMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000020) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.OperationMode report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ControlMode - */ -class ReadPumpConfigurationAndControlControlMode : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlControlMode() : ModelCommand("read") - { - AddArgument("attr-name", "control-mode"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlControlMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000021) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.ControlMode response", value); - } -}; - -class WritePumpConfigurationAndControlControlMode : public ModelCommand -{ -public: - WritePumpConfigurationAndControlControlMode() : ModelCommand("write") - { - AddArgument("attr-name", "control-mode"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WritePumpConfigurationAndControlControlMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) WriteAttribute (0x00000021) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint8_t mValue; -}; - -class ReportPumpConfigurationAndControlControlMode : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlControlMode() : ModelCommand("subscribe") - { - AddArgument("attr-name", "control-mode"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlControlMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000021) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.ControlMode report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AlarmMask - */ -class ReadPumpConfigurationAndControlAlarmMask : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlAlarmMask() : ModelCommand("read") - { - AddArgument("attr-name", "alarm-mask"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlAlarmMask() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x00000022) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.AlarmMask response", value); - } -}; - -class ReportPumpConfigurationAndControlAlarmMask : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlAlarmMask() : ModelCommand("subscribe") - { - AddArgument("attr-name", "alarm-mask"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlAlarmMask() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x00000022) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.AlarmMask report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadPumpConfigurationAndControlAttributeList : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.AttributeList response", value); - } -}; - -class ReportPumpConfigurationAndControlAttributeList : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute FeatureMap - */ -class ReadPumpConfigurationAndControlFeatureMap : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlFeatureMap() : ModelCommand("read") - { - AddArgument("attr-name", "feature-map"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlFeatureMap() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x0000FFFC) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint32_t value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.FeatureMap response", value); - } -}; - -class ReportPumpConfigurationAndControlFeatureMap : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlFeatureMap() : ModelCommand("subscribe") - { - AddArgument("attr-name", "feature-map"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlFeatureMap() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x0000FFFC) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint32_t value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.FeatureMap report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadPumpConfigurationAndControlClusterRevision : public ModelCommand -{ -public: - ReadPumpConfigurationAndControlClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadPumpConfigurationAndControlClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "PumpConfigurationAndControl.ClusterRevision response", value); - } -}; - -class ReportPumpConfigurationAndControlClusterRevision : public ModelCommand -{ -public: - ReportPumpConfigurationAndControlClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportPumpConfigurationAndControlClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000200) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::PumpConfigurationAndControlCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("PumpConfigurationAndControl.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster RelativeHumidityMeasurement | 0x0405 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * MeasuredValue | 0x0000 | -| * MinMeasuredValue | 0x0001 | -| * MaxMeasuredValue | 0x0002 | -| * Tolerance | 0x0003 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Attribute MeasuredValue - */ -class ReadRelativeHumidityMeasurementMeasuredValue : public ModelCommand -{ -public: - ReadRelativeHumidityMeasurementMeasuredValue() : ModelCommand("read") - { - AddArgument("attr-name", "measured-value"); - ModelCommand::AddArguments(); - } - - ~ReadRelativeHumidityMeasurementMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::RelativeHumidityMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "RelativeHumidityMeasurement.MeasuredValue response", value); - } -}; - -class ReportRelativeHumidityMeasurementMeasuredValue : public ModelCommand -{ -public: - ReportRelativeHumidityMeasurementMeasuredValue() : ModelCommand("subscribe") - { - AddArgument("attr-name", "measured-value"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportRelativeHumidityMeasurementMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::RelativeHumidityMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("RelativeHumidityMeasurement.MeasuredValue report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MinMeasuredValue - */ -class ReadRelativeHumidityMeasurementMinMeasuredValue : public ModelCommand -{ -public: - ReadRelativeHumidityMeasurementMinMeasuredValue() : ModelCommand("read") - { - AddArgument("attr-name", "min-measured-value"); - ModelCommand::AddArguments(); - } - - ~ReadRelativeHumidityMeasurementMinMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::RelativeHumidityMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "RelativeHumidityMeasurement.MinMeasuredValue response", value); - } -}; - -class ReportRelativeHumidityMeasurementMinMeasuredValue : public ModelCommand -{ -public: - ReportRelativeHumidityMeasurementMinMeasuredValue() : ModelCommand("subscribe") - { - AddArgument("attr-name", "min-measured-value"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportRelativeHumidityMeasurementMinMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::RelativeHumidityMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("RelativeHumidityMeasurement.MinMeasuredValue report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MaxMeasuredValue - */ -class ReadRelativeHumidityMeasurementMaxMeasuredValue : public ModelCommand -{ -public: - ReadRelativeHumidityMeasurementMaxMeasuredValue() : ModelCommand("read") - { - AddArgument("attr-name", "max-measured-value"); - ModelCommand::AddArguments(); - } - - ~ReadRelativeHumidityMeasurementMaxMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::RelativeHumidityMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "RelativeHumidityMeasurement.MaxMeasuredValue response", value); - } -}; - -class ReportRelativeHumidityMeasurementMaxMeasuredValue : public ModelCommand -{ -public: - ReportRelativeHumidityMeasurementMaxMeasuredValue() : ModelCommand("subscribe") - { - AddArgument("attr-name", "max-measured-value"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportRelativeHumidityMeasurementMaxMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::RelativeHumidityMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("RelativeHumidityMeasurement.MaxMeasuredValue report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Tolerance - */ -class ReadRelativeHumidityMeasurementTolerance : public ModelCommand -{ -public: - ReadRelativeHumidityMeasurementTolerance() : ModelCommand("read") - { - AddArgument("attr-name", "tolerance"); - ModelCommand::AddArguments(); - } - - ~ReadRelativeHumidityMeasurementTolerance() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::RelativeHumidityMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "RelativeHumidityMeasurement.Tolerance response", value); - } -}; - -class ReportRelativeHumidityMeasurementTolerance : public ModelCommand -{ -public: - ReportRelativeHumidityMeasurementTolerance() : ModelCommand("subscribe") - { - AddArgument("attr-name", "tolerance"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportRelativeHumidityMeasurementTolerance() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::RelativeHumidityMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("RelativeHumidityMeasurement.Tolerance report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadRelativeHumidityMeasurementAttributeList : public ModelCommand -{ -public: - ReadRelativeHumidityMeasurementAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadRelativeHumidityMeasurementAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::RelativeHumidityMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "RelativeHumidityMeasurement.AttributeList response", value); - } -}; - -class ReportRelativeHumidityMeasurementAttributeList : public ModelCommand -{ -public: - ReportRelativeHumidityMeasurementAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportRelativeHumidityMeasurementAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::RelativeHumidityMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("RelativeHumidityMeasurement.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadRelativeHumidityMeasurementClusterRevision : public ModelCommand -{ -public: - ReadRelativeHumidityMeasurementClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadRelativeHumidityMeasurementClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::RelativeHumidityMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "RelativeHumidityMeasurement.ClusterRevision response", value); - } -}; - -class ReportRelativeHumidityMeasurementClusterRevision : public ModelCommand -{ -public: - ReportRelativeHumidityMeasurementClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportRelativeHumidityMeasurementClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000405) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::RelativeHumidityMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("RelativeHumidityMeasurement.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster Scenes | 0x0005 | -|------------------------------------------------------------------------------| -| Commands: | | -| * AddScene | 0x00 | -| * GetSceneMembership | 0x06 | -| * RecallScene | 0x05 | -| * RemoveAllScenes | 0x03 | -| * RemoveScene | 0x02 | -| * StoreScene | 0x04 | -| * ViewScene | 0x01 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * SceneCount | 0x0000 | -| * CurrentScene | 0x0001 | -| * CurrentGroup | 0x0002 | -| * SceneValid | 0x0003 | -| * NameSupport | 0x0004 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command AddScene - */ -class ScenesAddScene : public ModelCommand -{ -public: - ScenesAddScene() : ModelCommand("add-scene"), mComplex_ExtensionFieldSets(&mRequest.extensionFieldSets) - { - AddArgument("GroupId", 0, UINT16_MAX, &mRequest.groupId); - AddArgument("SceneId", 0, UINT8_MAX, &mRequest.sceneId); - AddArgument("TransitionTime", 0, UINT16_MAX, &mRequest.transitionTime); - AddArgument("SceneName", &mRequest.sceneName); - AddArgument("ExtensionFieldSets", &mComplex_ExtensionFieldSets); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnScenesAddSceneResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Scenes::Commands::AddScene::Type mRequest; - TypedComplexArgument> - mComplex_ExtensionFieldSets; -}; - -/* - * Command GetSceneMembership - */ -class ScenesGetSceneMembership : public ModelCommand -{ -public: - ScenesGetSceneMembership() : ModelCommand("get-scene-membership") - { - AddArgument("GroupId", 0, UINT16_MAX, &mRequest.groupId); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000006) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnScenesGetSceneMembershipResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Scenes::Commands::GetSceneMembership::Type mRequest; -}; - -/* - * Command RecallScene - */ -class ScenesRecallScene : public ModelCommand -{ -public: - ScenesRecallScene() : ModelCommand("recall-scene") - { - AddArgument("GroupId", 0, UINT16_MAX, &mRequest.groupId); - AddArgument("SceneId", 0, UINT8_MAX, &mRequest.sceneId); - AddArgument("TransitionTime", 0, UINT16_MAX, &mRequest.transitionTime); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000005) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Scenes::Commands::RecallScene::Type mRequest; -}; - -/* - * Command RemoveAllScenes - */ -class ScenesRemoveAllScenes : public ModelCommand -{ -public: - ScenesRemoveAllScenes() : ModelCommand("remove-all-scenes") - { - AddArgument("GroupId", 0, UINT16_MAX, &mRequest.groupId); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000003) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnScenesRemoveAllScenesResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Scenes::Commands::RemoveAllScenes::Type mRequest; -}; - -/* - * Command RemoveScene - */ -class ScenesRemoveScene : public ModelCommand -{ -public: - ScenesRemoveScene() : ModelCommand("remove-scene") - { - AddArgument("GroupId", 0, UINT16_MAX, &mRequest.groupId); - AddArgument("SceneId", 0, UINT8_MAX, &mRequest.sceneId); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000002) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnScenesRemoveSceneResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Scenes::Commands::RemoveScene::Type mRequest; -}; - -/* - * Command StoreScene - */ -class ScenesStoreScene : public ModelCommand -{ -public: - ScenesStoreScene() : ModelCommand("store-scene") - { - AddArgument("GroupId", 0, UINT16_MAX, &mRequest.groupId); - AddArgument("SceneId", 0, UINT8_MAX, &mRequest.sceneId); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000004) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnScenesStoreSceneResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Scenes::Commands::StoreScene::Type mRequest; -}; - -/* - * Command ViewScene - */ -class ScenesViewScene : public ModelCommand -{ -public: - ScenesViewScene() : ModelCommand("view-scene") - { - AddArgument("GroupId", 0, UINT16_MAX, &mRequest.groupId); - AddArgument("SceneId", 0, UINT8_MAX, &mRequest.sceneId); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000001) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnScenesViewSceneResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Scenes::Commands::ViewScene::Type mRequest; -}; - -/* - * Attribute SceneCount - */ -class ReadScenesSceneCount : public ModelCommand -{ -public: - ReadScenesSceneCount() : ModelCommand("read") - { - AddArgument("attr-name", "scene-count"); - ModelCommand::AddArguments(); - } - - ~ReadScenesSceneCount() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::ScenesCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "Scenes.SceneCount response", value); - } -}; - -class ReportScenesSceneCount : public ModelCommand -{ -public: - ReportScenesSceneCount() : ModelCommand("subscribe") - { - AddArgument("attr-name", "scene-count"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportScenesSceneCount() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::ScenesCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) { DataModelLogger::LogValue("Scenes.SceneCount report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute CurrentScene - */ -class ReadScenesCurrentScene : public ModelCommand -{ -public: - ReadScenesCurrentScene() : ModelCommand("read") - { - AddArgument("attr-name", "current-scene"); - ModelCommand::AddArguments(); - } - - ~ReadScenesCurrentScene() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::ScenesCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "Scenes.CurrentScene response", value); - } -}; - -class ReportScenesCurrentScene : public ModelCommand -{ -public: - ReportScenesCurrentScene() : ModelCommand("subscribe") - { - AddArgument("attr-name", "current-scene"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportScenesCurrentScene() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::ScenesCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) { DataModelLogger::LogValue("Scenes.CurrentScene report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute CurrentGroup - */ -class ReadScenesCurrentGroup : public ModelCommand -{ -public: - ReadScenesCurrentGroup() : ModelCommand("read") - { - AddArgument("attr-name", "current-group"); - ModelCommand::AddArguments(); - } - - ~ReadScenesCurrentGroup() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::ScenesCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "Scenes.CurrentGroup response", value); - } -}; - -class ReportScenesCurrentGroup : public ModelCommand -{ -public: - ReportScenesCurrentGroup() : ModelCommand("subscribe") - { - AddArgument("attr-name", "current-group"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportScenesCurrentGroup() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::ScenesCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) { DataModelLogger::LogValue("Scenes.CurrentGroup report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute SceneValid - */ -class ReadScenesSceneValid : public ModelCommand -{ -public: - ReadScenesSceneValid() : ModelCommand("read") - { - AddArgument("attr-name", "scene-valid"); - ModelCommand::AddArguments(); - } - - ~ReadScenesSceneValid() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::ScenesCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, bool value) - { - OnGeneralAttributeEventResponse(context, "Scenes.SceneValid response", value); - } -}; - -class ReportScenesSceneValid : public ModelCommand -{ -public: - ReportScenesSceneValid() : ModelCommand("subscribe") - { - AddArgument("attr-name", "scene-valid"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportScenesSceneValid() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::ScenesCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, bool value) { DataModelLogger::LogValue("Scenes.SceneValid report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NameSupport - */ -class ReadScenesNameSupport : public ModelCommand -{ -public: - ReadScenesNameSupport() : ModelCommand("read") - { - AddArgument("attr-name", "name-support"); - ModelCommand::AddArguments(); - } - - ~ReadScenesNameSupport() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::ScenesCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "Scenes.NameSupport response", value); - } -}; - -class ReportScenesNameSupport : public ModelCommand -{ -public: - ReportScenesNameSupport() : ModelCommand("subscribe") - { - AddArgument("attr-name", "name-support"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportScenesNameSupport() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::ScenesCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) { DataModelLogger::LogValue("Scenes.NameSupport report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadScenesAttributeList : public ModelCommand -{ -public: - ReadScenesAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadScenesAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::ScenesCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "Scenes.AttributeList response", value); - } -}; - -class ReportScenesAttributeList : public ModelCommand -{ -public: - ReportScenesAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportScenesAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::ScenesCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("Scenes.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadScenesClusterRevision : public ModelCommand -{ -public: - ReadScenesClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadScenesClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::ScenesCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "Scenes.ClusterRevision response", value); - } -}; - -class ReportScenesClusterRevision : public ModelCommand -{ -public: - ReportScenesClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportScenesClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::ScenesCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("Scenes.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster SoftwareDiagnostics | 0x0034 | -|------------------------------------------------------------------------------| -| Commands: | | -| * ResetWatermarks | 0x00 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * ThreadMetrics | 0x0000 | -| * CurrentHeapFree | 0x0001 | -| * CurrentHeapUsed | 0x0002 | -| * CurrentHeapHighWatermark | 0x0003 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -| * SoftwareFault | 0x0000 | -\*----------------------------------------------------------------------------*/ - -/* - * Command ResetWatermarks - */ -class SoftwareDiagnosticsResetWatermarks : public ModelCommand -{ -public: - SoftwareDiagnosticsResetWatermarks() : ModelCommand("reset-watermarks") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::SoftwareDiagnostics::Commands::ResetWatermarks::Type mRequest; -}; - -/* - * Event SoftwareFault - */ -class ReadSoftwareDiagnosticsSoftwareFault : public ModelCommand -{ -public: - ReadSoftwareDiagnosticsSoftwareFault() : ModelCommand("read-event") - { - AddArgument("event-name", "software-fault"); - ModelCommand::AddArguments(); - } - - ~ReadSoftwareDiagnosticsSoftwareFault() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadEvent (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::SoftwareDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void OnEventResponse(void * context, - chip::app::Clusters::SoftwareDiagnostics::Events::SoftwareFault::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "SoftwareDiagnostics.SoftwareFault response", value); - } -}; - -class ReportSoftwareDiagnosticsSoftwareFault : public ModelCommand -{ -public: - ReportSoftwareDiagnosticsSoftwareFault() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "software-fault"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportSoftwareDiagnosticsSoftwareFault() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportEvent (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::SoftwareDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::SoftwareDiagnostics::Events::SoftwareFault::DecodableType value) - { - DataModelLogger::LogValue("SoftwareDiagnostics.SoftwareFault report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ThreadMetrics - */ -class ReadSoftwareDiagnosticsThreadMetrics : public ModelCommand -{ -public: - ReadSoftwareDiagnosticsThreadMetrics() : ModelCommand("read") - { - AddArgument("attr-name", "thread-metrics"); - ModelCommand::AddArguments(); - } - - ~ReadSoftwareDiagnosticsThreadMetrics() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::SoftwareDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse( - void * context, - const chip::app::DataModel::DecodableList & - value) - { - OnGeneralAttributeEventResponse(context, "SoftwareDiagnostics.ThreadMetrics response", value); - } -}; - -class ReportSoftwareDiagnosticsThreadMetrics : public ModelCommand -{ -public: - ReportSoftwareDiagnosticsThreadMetrics() : ModelCommand("subscribe") - { - AddArgument("attr-name", "thread-metrics"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportSoftwareDiagnosticsThreadMetrics() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::SoftwareDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport( - void * context, - const chip::app::DataModel::DecodableList & - value) - { - DataModelLogger::LogValue("SoftwareDiagnostics.ThreadMetrics report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute CurrentHeapFree - */ -class ReadSoftwareDiagnosticsCurrentHeapFree : public ModelCommand -{ -public: - ReadSoftwareDiagnosticsCurrentHeapFree() : ModelCommand("read") - { - AddArgument("attr-name", "current-heap-free"); - ModelCommand::AddArguments(); - } - - ~ReadSoftwareDiagnosticsCurrentHeapFree() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::SoftwareDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint64_t value) - { - OnGeneralAttributeEventResponse(context, "SoftwareDiagnostics.CurrentHeapFree response", value); - } -}; - -class ReportSoftwareDiagnosticsCurrentHeapFree : public ModelCommand -{ -public: - ReportSoftwareDiagnosticsCurrentHeapFree() : ModelCommand("subscribe") - { - AddArgument("attr-name", "current-heap-free"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportSoftwareDiagnosticsCurrentHeapFree() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::SoftwareDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint64_t value) - { - DataModelLogger::LogValue("SoftwareDiagnostics.CurrentHeapFree report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute CurrentHeapUsed - */ -class ReadSoftwareDiagnosticsCurrentHeapUsed : public ModelCommand -{ -public: - ReadSoftwareDiagnosticsCurrentHeapUsed() : ModelCommand("read") - { - AddArgument("attr-name", "current-heap-used"); - ModelCommand::AddArguments(); - } - - ~ReadSoftwareDiagnosticsCurrentHeapUsed() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::SoftwareDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint64_t value) - { - OnGeneralAttributeEventResponse(context, "SoftwareDiagnostics.CurrentHeapUsed response", value); - } -}; - -class ReportSoftwareDiagnosticsCurrentHeapUsed : public ModelCommand -{ -public: - ReportSoftwareDiagnosticsCurrentHeapUsed() : ModelCommand("subscribe") - { - AddArgument("attr-name", "current-heap-used"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportSoftwareDiagnosticsCurrentHeapUsed() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::SoftwareDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint64_t value) - { - DataModelLogger::LogValue("SoftwareDiagnostics.CurrentHeapUsed report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute CurrentHeapHighWatermark - */ -class ReadSoftwareDiagnosticsCurrentHeapHighWatermark : public ModelCommand -{ -public: - ReadSoftwareDiagnosticsCurrentHeapHighWatermark() : ModelCommand("read") - { - AddArgument("attr-name", "current-heap-high-watermark"); - ModelCommand::AddArguments(); - } - - ~ReadSoftwareDiagnosticsCurrentHeapHighWatermark() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::SoftwareDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint64_t value) - { - OnGeneralAttributeEventResponse(context, "SoftwareDiagnostics.CurrentHeapHighWatermark response", value); - } -}; - -class ReportSoftwareDiagnosticsCurrentHeapHighWatermark : public ModelCommand -{ -public: - ReportSoftwareDiagnosticsCurrentHeapHighWatermark() : ModelCommand("subscribe") - { - AddArgument("attr-name", "current-heap-high-watermark"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportSoftwareDiagnosticsCurrentHeapHighWatermark() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::SoftwareDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint64_t value) - { - DataModelLogger::LogValue("SoftwareDiagnostics.CurrentHeapHighWatermark report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadSoftwareDiagnosticsAttributeList : public ModelCommand -{ -public: - ReadSoftwareDiagnosticsAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadSoftwareDiagnosticsAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::SoftwareDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "SoftwareDiagnostics.AttributeList response", value); - } -}; - -class ReportSoftwareDiagnosticsAttributeList : public ModelCommand -{ -public: - ReportSoftwareDiagnosticsAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportSoftwareDiagnosticsAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::SoftwareDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("SoftwareDiagnostics.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute FeatureMap - */ -class ReadSoftwareDiagnosticsFeatureMap : public ModelCommand -{ -public: - ReadSoftwareDiagnosticsFeatureMap() : ModelCommand("read") - { - AddArgument("attr-name", "feature-map"); - ModelCommand::AddArguments(); - } - - ~ReadSoftwareDiagnosticsFeatureMap() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadAttribute (0x0000FFFC) on endpoint %" PRIu16, endpointId); - - chip::Controller::SoftwareDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint32_t value) - { - OnGeneralAttributeEventResponse(context, "SoftwareDiagnostics.FeatureMap response", value); - } -}; - -class ReportSoftwareDiagnosticsFeatureMap : public ModelCommand -{ -public: - ReportSoftwareDiagnosticsFeatureMap() : ModelCommand("subscribe") - { - AddArgument("attr-name", "feature-map"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportSoftwareDiagnosticsFeatureMap() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportAttribute (0x0000FFFC) on endpoint %" PRIu16, endpointId); - - chip::Controller::SoftwareDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint32_t value) - { - DataModelLogger::LogValue("SoftwareDiagnostics.FeatureMap report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadSoftwareDiagnosticsClusterRevision : public ModelCommand -{ -public: - ReadSoftwareDiagnosticsClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadSoftwareDiagnosticsClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::SoftwareDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "SoftwareDiagnostics.ClusterRevision response", value); - } -}; - -class ReportSoftwareDiagnosticsClusterRevision : public ModelCommand -{ -public: - ReportSoftwareDiagnosticsClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportSoftwareDiagnosticsClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000034) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::SoftwareDiagnosticsCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("SoftwareDiagnostics.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster Switch | 0x003B | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * NumberOfPositions | 0x0000 | -| * CurrentPosition | 0x0001 | -| * MultiPressMax | 0x0002 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -| * SwitchLatched | 0x0000 | -| * InitialPress | 0x0001 | -| * LongPress | 0x0002 | -| * ShortRelease | 0x0003 | -| * LongRelease | 0x0004 | -| * MultiPressOngoing | 0x0005 | -| * MultiPressComplete | 0x0006 | -\*----------------------------------------------------------------------------*/ - -/* - * Event SwitchLatched - */ -class ReadSwitchSwitchLatched : public ModelCommand -{ -public: - ReadSwitchSwitchLatched() : ModelCommand("read-event") - { - AddArgument("event-name", "switch-latched"); - ModelCommand::AddArguments(); - } - - ~ReadSwitchSwitchLatched() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadEvent (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent(this, OnEventResponse, - OnDefaultFailure); - } - - static void OnEventResponse(void * context, chip::app::Clusters::Switch::Events::SwitchLatched::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "Switch.SwitchLatched response", value); - } -}; - -class ReportSwitchSwitchLatched : public ModelCommand -{ -public: - ReportSwitchSwitchLatched() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "switch-latched"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportSwitchSwitchLatched() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportEvent (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::Switch::Events::SwitchLatched::DecodableType value) - { - DataModelLogger::LogValue("Switch.SwitchLatched report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event InitialPress - */ -class ReadSwitchInitialPress : public ModelCommand -{ -public: - ReadSwitchInitialPress() : ModelCommand("read-event") - { - AddArgument("event-name", "initial-press"); - ModelCommand::AddArguments(); - } - - ~ReadSwitchInitialPress() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadEvent (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent(this, OnEventResponse, - OnDefaultFailure); - } - - static void OnEventResponse(void * context, chip::app::Clusters::Switch::Events::InitialPress::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "Switch.InitialPress response", value); - } -}; - -class ReportSwitchInitialPress : public ModelCommand -{ -public: - ReportSwitchInitialPress() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "initial-press"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportSwitchInitialPress() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportEvent (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::Switch::Events::InitialPress::DecodableType value) - { - DataModelLogger::LogValue("Switch.InitialPress report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event LongPress - */ -class ReadSwitchLongPress : public ModelCommand -{ -public: - ReadSwitchLongPress() : ModelCommand("read-event") - { - AddArgument("event-name", "long-press"); - ModelCommand::AddArguments(); - } - - ~ReadSwitchLongPress() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadEvent (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent(this, OnEventResponse, - OnDefaultFailure); - } - - static void OnEventResponse(void * context, chip::app::Clusters::Switch::Events::LongPress::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "Switch.LongPress response", value); - } -}; - -class ReportSwitchLongPress : public ModelCommand -{ -public: - ReportSwitchLongPress() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "long-press"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportSwitchLongPress() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportEvent (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::Switch::Events::LongPress::DecodableType value) - { - DataModelLogger::LogValue("Switch.LongPress report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event ShortRelease - */ -class ReadSwitchShortRelease : public ModelCommand -{ -public: - ReadSwitchShortRelease() : ModelCommand("read-event") - { - AddArgument("event-name", "short-release"); - ModelCommand::AddArguments(); - } - - ~ReadSwitchShortRelease() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadEvent (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent(this, OnEventResponse, - OnDefaultFailure); - } - - static void OnEventResponse(void * context, chip::app::Clusters::Switch::Events::ShortRelease::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "Switch.ShortRelease response", value); - } -}; - -class ReportSwitchShortRelease : public ModelCommand -{ -public: - ReportSwitchShortRelease() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "short-release"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportSwitchShortRelease() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportEvent (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::Switch::Events::ShortRelease::DecodableType value) - { - DataModelLogger::LogValue("Switch.ShortRelease report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event LongRelease - */ -class ReadSwitchLongRelease : public ModelCommand -{ -public: - ReadSwitchLongRelease() : ModelCommand("read-event") - { - AddArgument("event-name", "long-release"); - ModelCommand::AddArguments(); - } - - ~ReadSwitchLongRelease() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadEvent (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent(this, OnEventResponse, - OnDefaultFailure); - } - - static void OnEventResponse(void * context, chip::app::Clusters::Switch::Events::LongRelease::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "Switch.LongRelease response", value); - } -}; - -class ReportSwitchLongRelease : public ModelCommand -{ -public: - ReportSwitchLongRelease() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "long-release"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportSwitchLongRelease() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportEvent (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::Switch::Events::LongRelease::DecodableType value) - { - DataModelLogger::LogValue("Switch.LongRelease report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event MultiPressOngoing - */ -class ReadSwitchMultiPressOngoing : public ModelCommand -{ -public: - ReadSwitchMultiPressOngoing() : ModelCommand("read-event") - { - AddArgument("event-name", "multi-press-ongoing"); - ModelCommand::AddArguments(); - } - - ~ReadSwitchMultiPressOngoing() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadEvent (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent(this, OnEventResponse, - OnDefaultFailure); - } - - static void OnEventResponse(void * context, chip::app::Clusters::Switch::Events::MultiPressOngoing::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "Switch.MultiPressOngoing response", value); - } -}; - -class ReportSwitchMultiPressOngoing : public ModelCommand -{ -public: - ReportSwitchMultiPressOngoing() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "multi-press-ongoing"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportSwitchMultiPressOngoing() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportEvent (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::Switch::Events::MultiPressOngoing::DecodableType value) - { - DataModelLogger::LogValue("Switch.MultiPressOngoing report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event MultiPressComplete - */ -class ReadSwitchMultiPressComplete : public ModelCommand -{ -public: - ReadSwitchMultiPressComplete() : ModelCommand("read-event") - { - AddArgument("event-name", "multi-press-complete"); - ModelCommand::AddArguments(); - } - - ~ReadSwitchMultiPressComplete() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadEvent (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent(this, OnEventResponse, - OnDefaultFailure); - } - - static void OnEventResponse(void * context, chip::app::Clusters::Switch::Events::MultiPressComplete::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "Switch.MultiPressComplete response", value); - } -}; - -class ReportSwitchMultiPressComplete : public ModelCommand -{ -public: - ReportSwitchMultiPressComplete() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "multi-press-complete"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportSwitchMultiPressComplete() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportEvent (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::Switch::Events::MultiPressComplete::DecodableType value) - { - DataModelLogger::LogValue("Switch.MultiPressComplete report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NumberOfPositions - */ -class ReadSwitchNumberOfPositions : public ModelCommand -{ -public: - ReadSwitchNumberOfPositions() : ModelCommand("read") - { - AddArgument("attr-name", "number-of-positions"); - ModelCommand::AddArguments(); - } - - ~ReadSwitchNumberOfPositions() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "Switch.NumberOfPositions response", value); - } -}; - -class ReportSwitchNumberOfPositions : public ModelCommand -{ -public: - ReportSwitchNumberOfPositions() : ModelCommand("subscribe") - { - AddArgument("attr-name", "number-of-positions"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportSwitchNumberOfPositions() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("Switch.NumberOfPositions report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute CurrentPosition - */ -class ReadSwitchCurrentPosition : public ModelCommand -{ -public: - ReadSwitchCurrentPosition() : ModelCommand("read") - { - AddArgument("attr-name", "current-position"); - ModelCommand::AddArguments(); - } - - ~ReadSwitchCurrentPosition() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "Switch.CurrentPosition response", value); - } -}; - -class ReportSwitchCurrentPosition : public ModelCommand -{ -public: - ReportSwitchCurrentPosition() : ModelCommand("subscribe") - { - AddArgument("attr-name", "current-position"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportSwitchCurrentPosition() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("Switch.CurrentPosition report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MultiPressMax - */ -class ReadSwitchMultiPressMax : public ModelCommand -{ -public: - ReadSwitchMultiPressMax() : ModelCommand("read") - { - AddArgument("attr-name", "multi-press-max"); - ModelCommand::AddArguments(); - } - - ~ReadSwitchMultiPressMax() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "Switch.MultiPressMax response", value); - } -}; - -class ReportSwitchMultiPressMax : public ModelCommand -{ -public: - ReportSwitchMultiPressMax() : ModelCommand("subscribe") - { - AddArgument("attr-name", "multi-press-max"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportSwitchMultiPressMax() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) { DataModelLogger::LogValue("Switch.MultiPressMax report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadSwitchAttributeList : public ModelCommand -{ -public: - ReadSwitchAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadSwitchAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "Switch.AttributeList response", value); - } -}; - -class ReportSwitchAttributeList : public ModelCommand -{ -public: - ReportSwitchAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportSwitchAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("Switch.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute FeatureMap - */ -class ReadSwitchFeatureMap : public ModelCommand -{ -public: - ReadSwitchFeatureMap() : ModelCommand("read") - { - AddArgument("attr-name", "feature-map"); - ModelCommand::AddArguments(); - } - - ~ReadSwitchFeatureMap() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadAttribute (0x0000FFFC) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint32_t value) - { - OnGeneralAttributeEventResponse(context, "Switch.FeatureMap response", value); - } -}; - -class ReportSwitchFeatureMap : public ModelCommand -{ -public: - ReportSwitchFeatureMap() : ModelCommand("subscribe") - { - AddArgument("attr-name", "feature-map"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportSwitchFeatureMap() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportAttribute (0x0000FFFC) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint32_t value) { DataModelLogger::LogValue("Switch.FeatureMap report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadSwitchClusterRevision : public ModelCommand -{ -public: - ReadSwitchClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadSwitchClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "Switch.ClusterRevision response", value); - } -}; - -class ReportSwitchClusterRevision : public ModelCommand -{ -public: - ReportSwitchClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportSwitchClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000003B) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::SwitchCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("Switch.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster TargetNavigator | 0x0505 | -|------------------------------------------------------------------------------| -| Commands: | | -| * NavigateTargetRequest | 0x00 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * TargetNavigatorList | 0x0000 | -| * CurrentNavigatorTarget | 0x0001 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command NavigateTargetRequest - */ -class TargetNavigatorNavigateTargetRequest : public ModelCommand -{ -public: - TargetNavigatorNavigateTargetRequest() : ModelCommand("navigate-target-request") - { - AddArgument("Target", 0, UINT8_MAX, &mRequest.target); - AddArgument("Data", &mRequest.data); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000505) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnTargetNavigatorNavigateTargetResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::TargetNavigator::Commands::NavigateTargetRequest::Type mRequest; -}; - -/* - * Attribute TargetNavigatorList - */ -class ReadTargetNavigatorTargetNavigatorList : public ModelCommand -{ -public: - ReadTargetNavigatorTargetNavigatorList() : ModelCommand("read") - { - AddArgument("attr-name", "target-navigator-list"); - ModelCommand::AddArguments(); - } - - ~ReadTargetNavigatorTargetNavigatorList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::TargetNavigatorCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse( - void * context, - const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "TargetNavigator.TargetNavigatorList response", value); - } -}; - -class ReportTargetNavigatorTargetNavigatorList : public ModelCommand -{ -public: - ReportTargetNavigatorTargetNavigatorList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "target-navigator-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTargetNavigatorTargetNavigatorList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::TargetNavigatorCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport( - void * context, - const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("TargetNavigator.TargetNavigatorList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute CurrentNavigatorTarget - */ -class ReadTargetNavigatorCurrentNavigatorTarget : public ModelCommand -{ -public: - ReadTargetNavigatorCurrentNavigatorTarget() : ModelCommand("read") - { - AddArgument("attr-name", "current-navigator-target"); - ModelCommand::AddArguments(); - } - - ~ReadTargetNavigatorCurrentNavigatorTarget() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::TargetNavigatorCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "TargetNavigator.CurrentNavigatorTarget response", value); - } -}; - -class ReportTargetNavigatorCurrentNavigatorTarget : public ModelCommand -{ -public: - ReportTargetNavigatorCurrentNavigatorTarget() : ModelCommand("subscribe") - { - AddArgument("attr-name", "current-navigator-target"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTargetNavigatorCurrentNavigatorTarget() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::TargetNavigatorCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("TargetNavigator.CurrentNavigatorTarget report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadTargetNavigatorAttributeList : public ModelCommand -{ -public: - ReadTargetNavigatorAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadTargetNavigatorAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::TargetNavigatorCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "TargetNavigator.AttributeList response", value); - } -}; - -class ReportTargetNavigatorAttributeList : public ModelCommand -{ -public: - ReportTargetNavigatorAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTargetNavigatorAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::TargetNavigatorCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("TargetNavigator.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadTargetNavigatorClusterRevision : public ModelCommand -{ -public: - ReadTargetNavigatorClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadTargetNavigatorClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::TargetNavigatorCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "TargetNavigator.ClusterRevision response", value); - } -}; - -class ReportTargetNavigatorClusterRevision : public ModelCommand -{ -public: - ReportTargetNavigatorClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTargetNavigatorClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000505) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::TargetNavigatorCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("TargetNavigator.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster TemperatureMeasurement | 0x0402 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * MeasuredValue | 0x0000 | -| * MinMeasuredValue | 0x0001 | -| * MaxMeasuredValue | 0x0002 | -| * Tolerance | 0x0003 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Attribute MeasuredValue - */ -class ReadTemperatureMeasurementMeasuredValue : public ModelCommand -{ -public: - ReadTemperatureMeasurementMeasuredValue() : ModelCommand("read") - { - AddArgument("attr-name", "measured-value"); - ModelCommand::AddArguments(); - } - - ~ReadTemperatureMeasurementMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::TemperatureMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "TemperatureMeasurement.MeasuredValue response", value); - } -}; - -class ReportTemperatureMeasurementMeasuredValue : public ModelCommand -{ -public: - ReportTemperatureMeasurementMeasuredValue() : ModelCommand("subscribe") - { - AddArgument("attr-name", "measured-value"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTemperatureMeasurementMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::TemperatureMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("TemperatureMeasurement.MeasuredValue report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MinMeasuredValue - */ -class ReadTemperatureMeasurementMinMeasuredValue : public ModelCommand -{ -public: - ReadTemperatureMeasurementMinMeasuredValue() : ModelCommand("read") - { - AddArgument("attr-name", "min-measured-value"); - ModelCommand::AddArguments(); - } - - ~ReadTemperatureMeasurementMinMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::TemperatureMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "TemperatureMeasurement.MinMeasuredValue response", value); - } -}; - -class ReportTemperatureMeasurementMinMeasuredValue : public ModelCommand -{ -public: - ReportTemperatureMeasurementMinMeasuredValue() : ModelCommand("subscribe") - { - AddArgument("attr-name", "min-measured-value"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTemperatureMeasurementMinMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::TemperatureMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("TemperatureMeasurement.MinMeasuredValue report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MaxMeasuredValue - */ -class ReadTemperatureMeasurementMaxMeasuredValue : public ModelCommand -{ -public: - ReadTemperatureMeasurementMaxMeasuredValue() : ModelCommand("read") - { - AddArgument("attr-name", "max-measured-value"); - ModelCommand::AddArguments(); - } - - ~ReadTemperatureMeasurementMaxMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::TemperatureMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "TemperatureMeasurement.MaxMeasuredValue response", value); - } -}; - -class ReportTemperatureMeasurementMaxMeasuredValue : public ModelCommand -{ -public: - ReportTemperatureMeasurementMaxMeasuredValue() : ModelCommand("subscribe") - { - AddArgument("attr-name", "max-measured-value"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTemperatureMeasurementMaxMeasuredValue() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::TemperatureMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("TemperatureMeasurement.MaxMeasuredValue report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Tolerance - */ -class ReadTemperatureMeasurementTolerance : public ModelCommand -{ -public: - ReadTemperatureMeasurementTolerance() : ModelCommand("read") - { - AddArgument("attr-name", "tolerance"); - ModelCommand::AddArguments(); - } - - ~ReadTemperatureMeasurementTolerance() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::TemperatureMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "TemperatureMeasurement.Tolerance response", value); - } -}; - -class ReportTemperatureMeasurementTolerance : public ModelCommand -{ -public: - ReportTemperatureMeasurementTolerance() : ModelCommand("subscribe") - { - AddArgument("attr-name", "tolerance"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTemperatureMeasurementTolerance() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::TemperatureMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("TemperatureMeasurement.Tolerance report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadTemperatureMeasurementAttributeList : public ModelCommand -{ -public: - ReadTemperatureMeasurementAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadTemperatureMeasurementAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::TemperatureMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "TemperatureMeasurement.AttributeList response", value); - } -}; - -class ReportTemperatureMeasurementAttributeList : public ModelCommand -{ -public: - ReportTemperatureMeasurementAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTemperatureMeasurementAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::TemperatureMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("TemperatureMeasurement.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadTemperatureMeasurementClusterRevision : public ModelCommand -{ -public: - ReadTemperatureMeasurementClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadTemperatureMeasurementClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::TemperatureMeasurementCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "TemperatureMeasurement.ClusterRevision response", value); - } -}; - -class ReportTemperatureMeasurementClusterRevision : public ModelCommand -{ -public: - ReportTemperatureMeasurementClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTemperatureMeasurementClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000402) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::TemperatureMeasurementCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("TemperatureMeasurement.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster TestCluster | 0x050F | -|------------------------------------------------------------------------------| -| Commands: | | -| * SimpleStructEchoRequest | 0x11 | -| * Test | 0x00 | -| * TestAddArguments | 0x04 | -| * TestEmitTestEventRequest | 0x14 | -| * TestEnumsRequest | 0x0E | -| * TestListInt8UArgumentRequest | 0x0A | -| * TestListInt8UReverseRequest | 0x0D | -| * TestListNestedStructListArgumentRequest | 0x0C | -| * TestListStructArgumentRequest | 0x09 | -| * TestNestedStructArgumentRequest | 0x08 | -| * TestNestedStructListArgumentRequest | 0x0B | -| * TestNotHandled | 0x01 | -| * TestNullableOptionalRequest | 0x0F | -| * TestSimpleOptionalArgumentRequest | 0x13 | -| * TestSpecific | 0x02 | -| * TestStructArgumentRequest | 0x07 | -| * TestUnknownCommand | 0x03 | -| * TimedInvokeRequest | 0x12 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * Boolean | 0x0000 | -| * Bitmap8 | 0x0001 | -| * Bitmap16 | 0x0002 | -| * Bitmap32 | 0x0003 | -| * Bitmap64 | 0x0004 | -| * Int8u | 0x0005 | -| * Int16u | 0x0006 | -| * Int24u | 0x0007 | -| * Int32u | 0x0008 | -| * Int40u | 0x0009 | -| * Int48u | 0x000A | -| * Int56u | 0x000B | -| * Int64u | 0x000C | -| * Int8s | 0x000D | -| * Int16s | 0x000E | -| * Int24s | 0x000F | -| * Int32s | 0x0010 | -| * Int40s | 0x0011 | -| * Int48s | 0x0012 | -| * Int56s | 0x0013 | -| * Int64s | 0x0014 | -| * Enum8 | 0x0015 | -| * Enum16 | 0x0016 | -| * FloatSingle | 0x0017 | -| * FloatDouble | 0x0018 | -| * OctetString | 0x0019 | -| * ListInt8u | 0x001A | -| * ListOctetString | 0x001B | -| * ListStructOctetString | 0x001C | -| * LongOctetString | 0x001D | -| * CharString | 0x001E | -| * LongCharString | 0x001F | -| * EpochUs | 0x0020 | -| * EpochS | 0x0021 | -| * VendorId | 0x0022 | -| * ListNullablesAndOptionalsStruct | 0x0023 | -| * EnumAttr | 0x0024 | -| * StructAttr | 0x0025 | -| * RangeRestrictedInt8u | 0x0026 | -| * RangeRestrictedInt8s | 0x0027 | -| * RangeRestrictedInt16u | 0x0028 | -| * RangeRestrictedInt16s | 0x0029 | -| * ListLongOctetString | 0x002A | -| * TimedWriteBoolean | 0x0030 | -| * GeneralErrorBoolean | 0x0031 | -| * ClusterErrorBoolean | 0x0032 | -| * Unsupported | 0x00FF | -| * NullableBoolean | 0x8000 | -| * NullableBitmap8 | 0x8001 | -| * NullableBitmap16 | 0x8002 | -| * NullableBitmap32 | 0x8003 | -| * NullableBitmap64 | 0x8004 | -| * NullableInt8u | 0x8005 | -| * NullableInt16u | 0x8006 | -| * NullableInt24u | 0x8007 | -| * NullableInt32u | 0x8008 | -| * NullableInt40u | 0x8009 | -| * NullableInt48u | 0x800A | -| * NullableInt56u | 0x800B | -| * NullableInt64u | 0x800C | -| * NullableInt8s | 0x800D | -| * NullableInt16s | 0x800E | -| * NullableInt24s | 0x800F | -| * NullableInt32s | 0x8010 | -| * NullableInt40s | 0x8011 | -| * NullableInt48s | 0x8012 | -| * NullableInt56s | 0x8013 | -| * NullableInt64s | 0x8014 | -| * NullableEnum8 | 0x8015 | -| * NullableEnum16 | 0x8016 | -| * NullableFloatSingle | 0x8017 | -| * NullableFloatDouble | 0x8018 | -| * NullableOctetString | 0x8019 | -| * NullableCharString | 0x801E | -| * NullableEnumAttr | 0x8024 | -| * NullableStruct | 0x8025 | -| * NullableRangeRestrictedInt8u | 0x8026 | -| * NullableRangeRestrictedInt8s | 0x8027 | -| * NullableRangeRestrictedInt16u | 0x8028 | -| * NullableRangeRestrictedInt16s | 0x8029 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -| * TestEvent | 0x0001 | -| * TestFabricScopedEvent | 0x0002 | -\*----------------------------------------------------------------------------*/ - -/* - * Command SimpleStructEchoRequest - */ -class TestClusterSimpleStructEchoRequest : public ModelCommand -{ -public: - TestClusterSimpleStructEchoRequest() : ModelCommand("simple-struct-echo-request"), mComplex_Arg1(&mRequest.arg1) - { - AddArgument("Arg1", &mComplex_Arg1); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000011) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnTestClusterSimpleStructResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::TestCluster::Commands::SimpleStructEchoRequest::Type mRequest; - TypedComplexArgument mComplex_Arg1; -}; - -/* - * Command Test - */ -class TestClusterTest : public ModelCommand -{ -public: - TestClusterTest() : ModelCommand("test") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::TestCluster::Commands::Test::Type mRequest; -}; - -/* - * Command TestAddArguments - */ -class TestClusterTestAddArguments : public ModelCommand -{ -public: - TestClusterTestAddArguments() : ModelCommand("test-add-arguments") - { - AddArgument("Arg1", 0, UINT8_MAX, &mRequest.arg1); - AddArgument("Arg2", 0, UINT8_MAX, &mRequest.arg2); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000004) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnTestClusterTestAddArgumentsResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::TestCluster::Commands::TestAddArguments::Type mRequest; -}; - -/* - * Command TestEmitTestEventRequest - */ -class TestClusterTestEmitTestEventRequest : public ModelCommand -{ -public: - TestClusterTestEmitTestEventRequest() : ModelCommand("test-emit-test-event-request") - { - AddArgument("Arg1", 0, UINT8_MAX, &mRequest.arg1); - AddArgument("Arg2", 0, UINT8_MAX, reinterpret_cast *>(&mRequest.arg2)); - AddArgument("Arg3", 0, 1, &mRequest.arg3); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000014) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnTestClusterTestEmitTestEventResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::TestCluster::Commands::TestEmitTestEventRequest::Type mRequest; -}; - -/* - * Command TestEnumsRequest - */ -class TestClusterTestEnumsRequest : public ModelCommand -{ -public: - TestClusterTestEnumsRequest() : ModelCommand("test-enums-request") - { - AddArgument("Arg1", 0, UINT16_MAX, &mRequest.arg1); - AddArgument("Arg2", 0, UINT8_MAX, reinterpret_cast *>(&mRequest.arg2)); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x0000000E) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnTestClusterTestEnumsResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::TestCluster::Commands::TestEnumsRequest::Type mRequest; -}; - -/* - * Command TestListInt8UArgumentRequest - */ -class TestClusterTestListInt8UArgumentRequest : public ModelCommand -{ -public: - TestClusterTestListInt8UArgumentRequest() : ModelCommand("test-list-int8uargument-request"), mComplex_Arg1(&mRequest.arg1) - { - AddArgument("Arg1", &mComplex_Arg1); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x0000000A) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnTestClusterBooleanResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::TestCluster::Commands::TestListInt8UArgumentRequest::Type mRequest; - TypedComplexArgument> mComplex_Arg1; -}; - -/* - * Command TestListInt8UReverseRequest - */ -class TestClusterTestListInt8UReverseRequest : public ModelCommand -{ -public: - TestClusterTestListInt8UReverseRequest() : ModelCommand("test-list-int8ureverse-request"), mComplex_Arg1(&mRequest.arg1) - { - AddArgument("Arg1", &mComplex_Arg1); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x0000000D) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnTestClusterTestListInt8UReverseResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::TestCluster::Commands::TestListInt8UReverseRequest::Type mRequest; - TypedComplexArgument> mComplex_Arg1; -}; - -/* - * Command TestListNestedStructListArgumentRequest - */ -class TestClusterTestListNestedStructListArgumentRequest : public ModelCommand -{ -public: - TestClusterTestListNestedStructListArgumentRequest() : - ModelCommand("test-list-nested-struct-list-argument-request"), mComplex_Arg1(&mRequest.arg1) - { - AddArgument("Arg1", &mComplex_Arg1); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x0000000C) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnTestClusterBooleanResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::TestCluster::Commands::TestListNestedStructListArgumentRequest::Type mRequest; - TypedComplexArgument> - mComplex_Arg1; -}; - -/* - * Command TestListStructArgumentRequest - */ -class TestClusterTestListStructArgumentRequest : public ModelCommand -{ -public: - TestClusterTestListStructArgumentRequest() : ModelCommand("test-list-struct-argument-request"), mComplex_Arg1(&mRequest.arg1) - { - AddArgument("Arg1", &mComplex_Arg1); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000009) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnTestClusterBooleanResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::TestCluster::Commands::TestListStructArgumentRequest::Type mRequest; - TypedComplexArgument> - mComplex_Arg1; -}; - -/* - * Command TestNestedStructArgumentRequest - */ -class TestClusterTestNestedStructArgumentRequest : public ModelCommand -{ -public: - TestClusterTestNestedStructArgumentRequest() : - ModelCommand("test-nested-struct-argument-request"), mComplex_Arg1(&mRequest.arg1) - { - AddArgument("Arg1", &mComplex_Arg1); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000008) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnTestClusterBooleanResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::TestCluster::Commands::TestNestedStructArgumentRequest::Type mRequest; - TypedComplexArgument mComplex_Arg1; -}; - -/* - * Command TestNestedStructListArgumentRequest - */ -class TestClusterTestNestedStructListArgumentRequest : public ModelCommand -{ -public: - TestClusterTestNestedStructListArgumentRequest() : - ModelCommand("test-nested-struct-list-argument-request"), mComplex_Arg1(&mRequest.arg1) - { - AddArgument("Arg1", &mComplex_Arg1); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x0000000B) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnTestClusterBooleanResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::TestCluster::Commands::TestNestedStructListArgumentRequest::Type mRequest; - TypedComplexArgument mComplex_Arg1; -}; - -/* - * Command TestNotHandled - */ -class TestClusterTestNotHandled : public ModelCommand -{ -public: - TestClusterTestNotHandled() : ModelCommand("test-not-handled") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000001) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::TestCluster::Commands::TestNotHandled::Type mRequest; -}; - -/* - * Command TestNullableOptionalRequest - */ -class TestClusterTestNullableOptionalRequest : public ModelCommand -{ -public: - TestClusterTestNullableOptionalRequest() : ModelCommand("test-nullable-optional-request") - { - AddArgument("Arg1", 0, UINT8_MAX, &mRequest.arg1); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x0000000F) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnTestClusterTestNullableOptionalResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type mRequest; -}; - -/* - * Command TestSimpleOptionalArgumentRequest - */ -class TestClusterTestSimpleOptionalArgumentRequest : public ModelCommand -{ -public: - TestClusterTestSimpleOptionalArgumentRequest() : ModelCommand("test-simple-optional-argument-request") - { - AddArgument("Arg1", 0, 1, &mRequest.arg1); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000013) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::TestCluster::Commands::TestSimpleOptionalArgumentRequest::Type mRequest; -}; - -/* - * Command TestSpecific - */ -class TestClusterTestSpecific : public ModelCommand -{ -public: - TestClusterTestSpecific() : ModelCommand("test-specific") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000002) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnTestClusterTestSpecificResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::TestCluster::Commands::TestSpecific::Type mRequest; -}; - -/* - * Command TestStructArgumentRequest - */ -class TestClusterTestStructArgumentRequest : public ModelCommand -{ -public: - TestClusterTestStructArgumentRequest() : ModelCommand("test-struct-argument-request"), mComplex_Arg1(&mRequest.arg1) - { - AddArgument("Arg1", &mComplex_Arg1); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000007) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnTestClusterBooleanResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::TestCluster::Commands::TestStructArgumentRequest::Type mRequest; - TypedComplexArgument mComplex_Arg1; -}; - -/* - * Command TestUnknownCommand - */ -class TestClusterTestUnknownCommand : public ModelCommand -{ -public: - TestClusterTestUnknownCommand() : ModelCommand("test-unknown-command") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000003) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::TestCluster::Commands::TestUnknownCommand::Type mRequest; -}; - -/* - * Command TimedInvokeRequest - */ -class TestClusterTimedInvokeRequest : public ModelCommand -{ -public: - TestClusterTimedInvokeRequest() : ModelCommand("timed-invoke-request") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000012) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::TestCluster::Commands::TimedInvokeRequest::Type mRequest; -}; - -/* - * Event TestEvent - */ -class ReadTestClusterTestEvent : public ModelCommand -{ -public: - ReadTestClusterTestEvent() : ModelCommand("read-event") - { - AddArgument("event-name", "test-event"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterTestEvent() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadEvent (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent(this, OnEventResponse, - OnDefaultFailure); - } - - static void OnEventResponse(void * context, chip::app::Clusters::TestCluster::Events::TestEvent::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.TestEvent response", value); - } -}; - -class ReportTestClusterTestEvent : public ModelCommand -{ -public: - ReportTestClusterTestEvent() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "test-event"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterTestEvent() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportEvent (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::TestCluster::Events::TestEvent::DecodableType value) - { - DataModelLogger::LogValue("TestCluster.TestEvent report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; -/* - * Event TestFabricScopedEvent - */ -class ReadTestClusterTestFabricScopedEvent : public ModelCommand -{ -public: - ReadTestClusterTestFabricScopedEvent() : ModelCommand("read-event") - { - AddArgument("event-name", "test-fabric-scoped-event"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterTestFabricScopedEvent() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadEvent (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadEvent( - this, OnEventResponse, OnDefaultFailure); - } - - static void OnEventResponse(void * context, - chip::app::Clusters::TestCluster::Events::TestFabricScopedEvent::DecodableType value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.TestFabricScopedEvent response", value); - } -}; - -class ReportTestClusterTestFabricScopedEvent : public ModelCommand -{ -public: - ReportTestClusterTestFabricScopedEvent() : ModelCommand("subscribe-event") - { - AddArgument("event-name", "test-fabric-scoped-event"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterTestFabricScopedEvent() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportEvent (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeEvent( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::TestCluster::Events::TestFabricScopedEvent::DecodableType value) - { - DataModelLogger::LogValue("TestCluster.TestFabricScopedEvent report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Boolean - */ -class ReadTestClusterBoolean : public ModelCommand -{ -public: - ReadTestClusterBoolean() : ModelCommand("read") - { - AddArgument("attr-name", "boolean"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterBoolean() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, bool value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.Boolean response", value); - } -}; - -class WriteTestClusterBoolean : public ModelCommand -{ -public: - WriteTestClusterBoolean() : ModelCommand("write") - { - AddArgument("attr-name", "boolean"); - AddArgument("attr-value", 0, 1, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterBoolean() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - bool mValue; -}; - -class ReportTestClusterBoolean : public ModelCommand -{ -public: - ReportTestClusterBoolean() : ModelCommand("subscribe") - { - AddArgument("attr-name", "boolean"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterBoolean() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, bool value) { DataModelLogger::LogValue("TestCluster.Boolean report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Bitmap8 - */ -class ReadTestClusterBitmap8 : public ModelCommand -{ -public: - ReadTestClusterBitmap8() : ModelCommand("read") - { - AddArgument("attr-name", "bitmap8"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterBitmap8() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.Bitmap8 response", value); - } -}; - -class WriteTestClusterBitmap8 : public ModelCommand -{ -public: - WriteTestClusterBitmap8() : ModelCommand("write") - { - AddArgument("attr-name", "bitmap8"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterBitmap8() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint8_t mValue; -}; - -class ReportTestClusterBitmap8 : public ModelCommand -{ -public: - ReportTestClusterBitmap8() : ModelCommand("subscribe") - { - AddArgument("attr-name", "bitmap8"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterBitmap8() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000001) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) { DataModelLogger::LogValue("TestCluster.Bitmap8 report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Bitmap16 - */ -class ReadTestClusterBitmap16 : public ModelCommand -{ -public: - ReadTestClusterBitmap16() : ModelCommand("read") - { - AddArgument("attr-name", "bitmap16"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterBitmap16() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.Bitmap16 response", value); - } -}; - -class WriteTestClusterBitmap16 : public ModelCommand -{ -public: - WriteTestClusterBitmap16() : ModelCommand("write") - { - AddArgument("attr-name", "bitmap16"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterBitmap16() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint16_t mValue; -}; - -class ReportTestClusterBitmap16 : public ModelCommand -{ -public: - ReportTestClusterBitmap16() : ModelCommand("subscribe") - { - AddArgument("attr-name", "bitmap16"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterBitmap16() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000002) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("TestCluster.Bitmap16 report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Bitmap32 - */ -class ReadTestClusterBitmap32 : public ModelCommand -{ -public: - ReadTestClusterBitmap32() : ModelCommand("read") - { - AddArgument("attr-name", "bitmap32"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterBitmap32() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint32_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.Bitmap32 response", value); - } -}; - -class WriteTestClusterBitmap32 : public ModelCommand -{ -public: - WriteTestClusterBitmap32() : ModelCommand("write") - { - AddArgument("attr-name", "bitmap32"); - AddArgument("attr-value", 0, UINT32_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterBitmap32() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint32_t mValue; -}; - -class ReportTestClusterBitmap32 : public ModelCommand -{ -public: - ReportTestClusterBitmap32() : ModelCommand("subscribe") - { - AddArgument("attr-name", "bitmap32"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterBitmap32() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint32_t value) - { - DataModelLogger::LogValue("TestCluster.Bitmap32 report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Bitmap64 - */ -class ReadTestClusterBitmap64 : public ModelCommand -{ -public: - ReadTestClusterBitmap64() : ModelCommand("read") - { - AddArgument("attr-name", "bitmap64"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterBitmap64() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint64_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.Bitmap64 response", value); - } -}; - -class WriteTestClusterBitmap64 : public ModelCommand -{ -public: - WriteTestClusterBitmap64() : ModelCommand("write") - { - AddArgument("attr-name", "bitmap64"); - AddArgument("attr-value", 0, UINT64_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterBitmap64() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint64_t mValue; -}; - -class ReportTestClusterBitmap64 : public ModelCommand -{ -public: - ReportTestClusterBitmap64() : ModelCommand("subscribe") - { - AddArgument("attr-name", "bitmap64"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterBitmap64() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint64_t value) - { - DataModelLogger::LogValue("TestCluster.Bitmap64 report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Int8u - */ -class ReadTestClusterInt8u : public ModelCommand -{ -public: - ReadTestClusterInt8u() : ModelCommand("read") - { - AddArgument("attr-name", "int8u"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterInt8u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.Int8u response", value); - } -}; - -class WriteTestClusterInt8u : public ModelCommand -{ -public: - WriteTestClusterInt8u() : ModelCommand("write") - { - AddArgument("attr-name", "int8u"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterInt8u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint8_t mValue; -}; - -class ReportTestClusterInt8u : public ModelCommand -{ -public: - ReportTestClusterInt8u() : ModelCommand("subscribe") - { - AddArgument("attr-name", "int8u"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterInt8u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) { DataModelLogger::LogValue("TestCluster.Int8u report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Int16u - */ -class ReadTestClusterInt16u : public ModelCommand -{ -public: - ReadTestClusterInt16u() : ModelCommand("read") - { - AddArgument("attr-name", "int16u"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterInt16u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.Int16u response", value); - } -}; - -class WriteTestClusterInt16u : public ModelCommand -{ -public: - WriteTestClusterInt16u() : ModelCommand("write") - { - AddArgument("attr-name", "int16u"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterInt16u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint16_t mValue; -}; - -class ReportTestClusterInt16u : public ModelCommand -{ -public: - ReportTestClusterInt16u() : ModelCommand("subscribe") - { - AddArgument("attr-name", "int16u"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterInt16u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) { DataModelLogger::LogValue("TestCluster.Int16u report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Int24u - */ -class ReadTestClusterInt24u : public ModelCommand -{ -public: - ReadTestClusterInt24u() : ModelCommand("read") - { - AddArgument("attr-name", "int24u"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterInt24u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000007) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint32_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.Int24u response", value); - } -}; - -class WriteTestClusterInt24u : public ModelCommand -{ -public: - WriteTestClusterInt24u() : ModelCommand("write") - { - AddArgument("attr-name", "int24u"); - AddArgument("attr-value", 0, UINT32_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterInt24u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000007) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint32_t mValue; -}; - -class ReportTestClusterInt24u : public ModelCommand -{ -public: - ReportTestClusterInt24u() : ModelCommand("subscribe") - { - AddArgument("attr-name", "int24u"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterInt24u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000007) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint32_t value) { DataModelLogger::LogValue("TestCluster.Int24u report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Int32u - */ -class ReadTestClusterInt32u : public ModelCommand -{ -public: - ReadTestClusterInt32u() : ModelCommand("read") - { - AddArgument("attr-name", "int32u"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterInt32u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000008) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint32_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.Int32u response", value); - } -}; - -class WriteTestClusterInt32u : public ModelCommand -{ -public: - WriteTestClusterInt32u() : ModelCommand("write") - { - AddArgument("attr-name", "int32u"); - AddArgument("attr-value", 0, UINT32_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterInt32u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000008) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint32_t mValue; -}; - -class ReportTestClusterInt32u : public ModelCommand -{ -public: - ReportTestClusterInt32u() : ModelCommand("subscribe") - { - AddArgument("attr-name", "int32u"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterInt32u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000008) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint32_t value) { DataModelLogger::LogValue("TestCluster.Int32u report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Int40u - */ -class ReadTestClusterInt40u : public ModelCommand -{ -public: - ReadTestClusterInt40u() : ModelCommand("read") - { - AddArgument("attr-name", "int40u"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterInt40u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000009) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint64_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.Int40u response", value); - } -}; - -class WriteTestClusterInt40u : public ModelCommand -{ -public: - WriteTestClusterInt40u() : ModelCommand("write") - { - AddArgument("attr-name", "int40u"); - AddArgument("attr-value", 0, UINT64_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterInt40u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000009) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint64_t mValue; -}; - -class ReportTestClusterInt40u : public ModelCommand -{ -public: - ReportTestClusterInt40u() : ModelCommand("subscribe") - { - AddArgument("attr-name", "int40u"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterInt40u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000009) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint64_t value) { DataModelLogger::LogValue("TestCluster.Int40u report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Int48u - */ -class ReadTestClusterInt48u : public ModelCommand -{ -public: - ReadTestClusterInt48u() : ModelCommand("read") - { - AddArgument("attr-name", "int48u"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterInt48u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000000A) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint64_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.Int48u response", value); - } -}; - -class WriteTestClusterInt48u : public ModelCommand -{ -public: - WriteTestClusterInt48u() : ModelCommand("write") - { - AddArgument("attr-name", "int48u"); - AddArgument("attr-value", 0, UINT64_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterInt48u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000000A) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint64_t mValue; -}; - -class ReportTestClusterInt48u : public ModelCommand -{ -public: - ReportTestClusterInt48u() : ModelCommand("subscribe") - { - AddArgument("attr-name", "int48u"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterInt48u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000000A) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint64_t value) { DataModelLogger::LogValue("TestCluster.Int48u report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Int56u - */ -class ReadTestClusterInt56u : public ModelCommand -{ -public: - ReadTestClusterInt56u() : ModelCommand("read") - { - AddArgument("attr-name", "int56u"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterInt56u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000000B) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint64_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.Int56u response", value); - } -}; - -class WriteTestClusterInt56u : public ModelCommand -{ -public: - WriteTestClusterInt56u() : ModelCommand("write") - { - AddArgument("attr-name", "int56u"); - AddArgument("attr-value", 0, UINT64_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterInt56u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000000B) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint64_t mValue; -}; - -class ReportTestClusterInt56u : public ModelCommand -{ -public: - ReportTestClusterInt56u() : ModelCommand("subscribe") - { - AddArgument("attr-name", "int56u"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterInt56u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000000B) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint64_t value) { DataModelLogger::LogValue("TestCluster.Int56u report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Int64u - */ -class ReadTestClusterInt64u : public ModelCommand -{ -public: - ReadTestClusterInt64u() : ModelCommand("read") - { - AddArgument("attr-name", "int64u"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterInt64u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000000C) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint64_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.Int64u response", value); - } -}; - -class WriteTestClusterInt64u : public ModelCommand -{ -public: - WriteTestClusterInt64u() : ModelCommand("write") - { - AddArgument("attr-name", "int64u"); - AddArgument("attr-value", 0, UINT64_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterInt64u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000000C) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint64_t mValue; -}; - -class ReportTestClusterInt64u : public ModelCommand -{ -public: - ReportTestClusterInt64u() : ModelCommand("subscribe") - { - AddArgument("attr-name", "int64u"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterInt64u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000000C) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint64_t value) { DataModelLogger::LogValue("TestCluster.Int64u report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Int8s - */ -class ReadTestClusterInt8s : public ModelCommand -{ -public: - ReadTestClusterInt8s() : ModelCommand("read") - { - AddArgument("attr-name", "int8s"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterInt8s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000000D) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int8_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.Int8s response", value); - } -}; - -class WriteTestClusterInt8s : public ModelCommand -{ -public: - WriteTestClusterInt8s() : ModelCommand("write") - { - AddArgument("attr-name", "int8s"); - AddArgument("attr-value", INT8_MIN, INT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterInt8s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000000D) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - int8_t mValue; -}; - -class ReportTestClusterInt8s : public ModelCommand -{ -public: - ReportTestClusterInt8s() : ModelCommand("subscribe") - { - AddArgument("attr-name", "int8s"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterInt8s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000000D) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int8_t value) { DataModelLogger::LogValue("TestCluster.Int8s report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Int16s - */ -class ReadTestClusterInt16s : public ModelCommand -{ -public: - ReadTestClusterInt16s() : ModelCommand("read") - { - AddArgument("attr-name", "int16s"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterInt16s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000000E) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.Int16s response", value); - } -}; - -class WriteTestClusterInt16s : public ModelCommand -{ -public: - WriteTestClusterInt16s() : ModelCommand("write") - { - AddArgument("attr-name", "int16s"); - AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterInt16s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000000E) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - int16_t mValue; -}; - -class ReportTestClusterInt16s : public ModelCommand -{ -public: - ReportTestClusterInt16s() : ModelCommand("subscribe") - { - AddArgument("attr-name", "int16s"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterInt16s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000000E) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) { DataModelLogger::LogValue("TestCluster.Int16s report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Int24s - */ -class ReadTestClusterInt24s : public ModelCommand -{ -public: - ReadTestClusterInt24s() : ModelCommand("read") - { - AddArgument("attr-name", "int24s"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterInt24s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000000F) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int32_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.Int24s response", value); - } -}; - -class WriteTestClusterInt24s : public ModelCommand -{ -public: - WriteTestClusterInt24s() : ModelCommand("write") - { - AddArgument("attr-name", "int24s"); - AddArgument("attr-value", INT32_MIN, INT32_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterInt24s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000000F) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - int32_t mValue; -}; - -class ReportTestClusterInt24s : public ModelCommand -{ -public: - ReportTestClusterInt24s() : ModelCommand("subscribe") - { - AddArgument("attr-name", "int24s"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterInt24s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000000F) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int32_t value) { DataModelLogger::LogValue("TestCluster.Int24s report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Int32s - */ -class ReadTestClusterInt32s : public ModelCommand -{ -public: - ReadTestClusterInt32s() : ModelCommand("read") - { - AddArgument("attr-name", "int32s"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterInt32s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000010) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int32_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.Int32s response", value); - } -}; - -class WriteTestClusterInt32s : public ModelCommand -{ -public: - WriteTestClusterInt32s() : ModelCommand("write") - { - AddArgument("attr-name", "int32s"); - AddArgument("attr-value", INT32_MIN, INT32_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterInt32s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000010) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - int32_t mValue; -}; - -class ReportTestClusterInt32s : public ModelCommand -{ -public: - ReportTestClusterInt32s() : ModelCommand("subscribe") - { - AddArgument("attr-name", "int32s"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterInt32s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000010) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int32_t value) { DataModelLogger::LogValue("TestCluster.Int32s report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Int40s - */ -class ReadTestClusterInt40s : public ModelCommand -{ -public: - ReadTestClusterInt40s() : ModelCommand("read") - { - AddArgument("attr-name", "int40s"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterInt40s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000011) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int64_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.Int40s response", value); - } -}; - -class WriteTestClusterInt40s : public ModelCommand -{ -public: - WriteTestClusterInt40s() : ModelCommand("write") - { - AddArgument("attr-name", "int40s"); - AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterInt40s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000011) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - int64_t mValue; -}; - -class ReportTestClusterInt40s : public ModelCommand -{ -public: - ReportTestClusterInt40s() : ModelCommand("subscribe") - { - AddArgument("attr-name", "int40s"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterInt40s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000011) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int64_t value) { DataModelLogger::LogValue("TestCluster.Int40s report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Int48s - */ -class ReadTestClusterInt48s : public ModelCommand -{ -public: - ReadTestClusterInt48s() : ModelCommand("read") - { - AddArgument("attr-name", "int48s"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterInt48s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000012) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int64_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.Int48s response", value); - } -}; - -class WriteTestClusterInt48s : public ModelCommand -{ -public: - WriteTestClusterInt48s() : ModelCommand("write") - { - AddArgument("attr-name", "int48s"); - AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterInt48s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000012) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - int64_t mValue; -}; - -class ReportTestClusterInt48s : public ModelCommand -{ -public: - ReportTestClusterInt48s() : ModelCommand("subscribe") - { - AddArgument("attr-name", "int48s"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterInt48s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000012) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int64_t value) { DataModelLogger::LogValue("TestCluster.Int48s report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Int56s - */ -class ReadTestClusterInt56s : public ModelCommand -{ -public: - ReadTestClusterInt56s() : ModelCommand("read") - { - AddArgument("attr-name", "int56s"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterInt56s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000013) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int64_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.Int56s response", value); - } -}; - -class WriteTestClusterInt56s : public ModelCommand -{ -public: - WriteTestClusterInt56s() : ModelCommand("write") - { - AddArgument("attr-name", "int56s"); - AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterInt56s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000013) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - int64_t mValue; -}; - -class ReportTestClusterInt56s : public ModelCommand -{ -public: - ReportTestClusterInt56s() : ModelCommand("subscribe") - { - AddArgument("attr-name", "int56s"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterInt56s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000013) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int64_t value) { DataModelLogger::LogValue("TestCluster.Int56s report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Int64s - */ -class ReadTestClusterInt64s : public ModelCommand -{ -public: - ReadTestClusterInt64s() : ModelCommand("read") - { - AddArgument("attr-name", "int64s"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterInt64s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000014) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int64_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.Int64s response", value); - } -}; - -class WriteTestClusterInt64s : public ModelCommand -{ -public: - WriteTestClusterInt64s() : ModelCommand("write") - { - AddArgument("attr-name", "int64s"); - AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterInt64s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000014) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - int64_t mValue; -}; - -class ReportTestClusterInt64s : public ModelCommand -{ -public: - ReportTestClusterInt64s() : ModelCommand("subscribe") - { - AddArgument("attr-name", "int64s"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterInt64s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000014) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int64_t value) { DataModelLogger::LogValue("TestCluster.Int64s report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Enum8 - */ -class ReadTestClusterEnum8 : public ModelCommand -{ -public: - ReadTestClusterEnum8() : ModelCommand("read") - { - AddArgument("attr-name", "enum8"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterEnum8() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000015) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.Enum8 response", value); - } -}; - -class WriteTestClusterEnum8 : public ModelCommand -{ -public: - WriteTestClusterEnum8() : ModelCommand("write") - { - AddArgument("attr-name", "enum8"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterEnum8() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000015) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint8_t mValue; -}; - -class ReportTestClusterEnum8 : public ModelCommand -{ -public: - ReportTestClusterEnum8() : ModelCommand("subscribe") - { - AddArgument("attr-name", "enum8"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterEnum8() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000015) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) { DataModelLogger::LogValue("TestCluster.Enum8 report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Enum16 - */ -class ReadTestClusterEnum16 : public ModelCommand -{ -public: - ReadTestClusterEnum16() : ModelCommand("read") - { - AddArgument("attr-name", "enum16"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterEnum16() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000016) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.Enum16 response", value); - } -}; - -class WriteTestClusterEnum16 : public ModelCommand -{ -public: - WriteTestClusterEnum16() : ModelCommand("write") - { - AddArgument("attr-name", "enum16"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterEnum16() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000016) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint16_t mValue; -}; - -class ReportTestClusterEnum16 : public ModelCommand -{ -public: - ReportTestClusterEnum16() : ModelCommand("subscribe") - { - AddArgument("attr-name", "enum16"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterEnum16() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000016) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) { DataModelLogger::LogValue("TestCluster.Enum16 report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute FloatSingle - */ -class ReadTestClusterFloatSingle : public ModelCommand -{ -public: - ReadTestClusterFloatSingle() : ModelCommand("read") - { - AddArgument("attr-name", "float-single"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterFloatSingle() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000017) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, float value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.FloatSingle response", value); - } -}; - -class WriteTestClusterFloatSingle : public ModelCommand -{ -public: - WriteTestClusterFloatSingle() : ModelCommand("write") - { - AddArgument("attr-name", "float-single"); - AddArgument("attr-value", -std::numeric_limits::infinity(), std::numeric_limits::infinity(), &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterFloatSingle() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000017) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - float mValue; -}; - -class ReportTestClusterFloatSingle : public ModelCommand -{ -public: - ReportTestClusterFloatSingle() : ModelCommand("subscribe") - { - AddArgument("attr-name", "float-single"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterFloatSingle() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000017) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, float value) - { - DataModelLogger::LogValue("TestCluster.FloatSingle report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute FloatDouble - */ -class ReadTestClusterFloatDouble : public ModelCommand -{ -public: - ReadTestClusterFloatDouble() : ModelCommand("read") - { - AddArgument("attr-name", "float-double"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterFloatDouble() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000018) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, double value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.FloatDouble response", value); - } -}; - -class WriteTestClusterFloatDouble : public ModelCommand -{ -public: - WriteTestClusterFloatDouble() : ModelCommand("write") - { - AddArgument("attr-name", "float-double"); - AddArgument("attr-value", -std::numeric_limits::infinity(), std::numeric_limits::infinity(), &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterFloatDouble() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000018) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - double mValue; -}; - -class ReportTestClusterFloatDouble : public ModelCommand -{ -public: - ReportTestClusterFloatDouble() : ModelCommand("subscribe") - { - AddArgument("attr-name", "float-double"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterFloatDouble() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000018) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, double value) - { - DataModelLogger::LogValue("TestCluster.FloatDouble report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute OctetString - */ -class ReadTestClusterOctetString : public ModelCommand -{ -public: - ReadTestClusterOctetString() : ModelCommand("read") - { - AddArgument("attr-name", "octet-string"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterOctetString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000019) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::ByteSpan value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.OctetString response", value); - } -}; - -class WriteTestClusterOctetString : public ModelCommand -{ -public: - WriteTestClusterOctetString() : ModelCommand("write") - { - AddArgument("attr-name", "octet-string"); - AddArgument("attr-value", &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterOctetString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000019) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::ByteSpan mValue; -}; - -class ReportTestClusterOctetString : public ModelCommand -{ -public: - ReportTestClusterOctetString() : ModelCommand("subscribe") - { - AddArgument("attr-name", "octet-string"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterOctetString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000019) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::ByteSpan value) - { - DataModelLogger::LogValue("TestCluster.OctetString report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ListInt8u - */ -class ReadTestClusterListInt8u : public ModelCommand -{ -public: - ReadTestClusterListInt8u() : ModelCommand("read") - { - AddArgument("attr-name", "list-int8u"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterListInt8u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000001A) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.ListInt8u response", value); - } -}; - -class WriteTestClusterListInt8u : public ModelCommand -{ -public: - WriteTestClusterListInt8u() : ModelCommand("write"), mComplex(&mValue) - { - AddArgument("attr-name", "list-int8u"); - AddArgument("attr-value", &mComplex); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterListInt8u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000001A) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::List mValue; - TypedComplexArgument> mComplex; -}; - -class ReportTestClusterListInt8u : public ModelCommand -{ -public: - ReportTestClusterListInt8u() : ModelCommand("subscribe") - { - AddArgument("attr-name", "list-int8u"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterListInt8u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000001A) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("TestCluster.ListInt8u report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ListOctetString - */ -class ReadTestClusterListOctetString : public ModelCommand -{ -public: - ReadTestClusterListOctetString() : ModelCommand("read") - { - AddArgument("attr-name", "list-octet-string"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterListOctetString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000001B) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.ListOctetString response", value); - } -}; - -class WriteTestClusterListOctetString : public ModelCommand -{ -public: - WriteTestClusterListOctetString() : ModelCommand("write"), mComplex(&mValue) - { - AddArgument("attr-name", "list-octet-string"); - AddArgument("attr-value", &mComplex); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterListOctetString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000001B) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::List mValue; - TypedComplexArgument> mComplex; -}; - -class ReportTestClusterListOctetString : public ModelCommand -{ -public: - ReportTestClusterListOctetString() : ModelCommand("subscribe") - { - AddArgument("attr-name", "list-octet-string"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterListOctetString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000001B) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("TestCluster.ListOctetString report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ListStructOctetString - */ -class ReadTestClusterListStructOctetString : public ModelCommand -{ -public: - ReadTestClusterListStructOctetString() : ModelCommand("read") - { - AddArgument("attr-name", "list-struct-octet-string"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterListStructOctetString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000001C) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse( - void * context, - const chip::app::DataModel::DecodableList & - value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.ListStructOctetString response", value); - } -}; - -class WriteTestClusterListStructOctetString : public ModelCommand -{ -public: - WriteTestClusterListStructOctetString() : ModelCommand("write"), mComplex(&mValue) - { - AddArgument("attr-name", "list-struct-octet-string"); - AddArgument("attr-value", &mComplex); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterListStructOctetString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000001C) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::List mValue; - TypedComplexArgument> - mComplex; -}; - -class ReportTestClusterListStructOctetString : public ModelCommand -{ -public: - ReportTestClusterListStructOctetString() : ModelCommand("subscribe") - { - AddArgument("attr-name", "list-struct-octet-string"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterListStructOctetString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000001C) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport( - void * context, - const chip::app::DataModel::DecodableList & - value) - { - DataModelLogger::LogValue("TestCluster.ListStructOctetString report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute LongOctetString - */ -class ReadTestClusterLongOctetString : public ModelCommand -{ -public: - ReadTestClusterLongOctetString() : ModelCommand("read") - { - AddArgument("attr-name", "long-octet-string"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterLongOctetString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000001D) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::ByteSpan value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.LongOctetString response", value); - } -}; - -class WriteTestClusterLongOctetString : public ModelCommand -{ -public: - WriteTestClusterLongOctetString() : ModelCommand("write") - { - AddArgument("attr-name", "long-octet-string"); - AddArgument("attr-value", &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterLongOctetString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000001D) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::ByteSpan mValue; -}; - -class ReportTestClusterLongOctetString : public ModelCommand -{ -public: - ReportTestClusterLongOctetString() : ModelCommand("subscribe") - { - AddArgument("attr-name", "long-octet-string"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterLongOctetString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000001D) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::ByteSpan value) - { - DataModelLogger::LogValue("TestCluster.LongOctetString report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute CharString - */ -class ReadTestClusterCharString : public ModelCommand -{ -public: - ReadTestClusterCharString() : ModelCommand("read") - { - AddArgument("attr-name", "char-string"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterCharString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000001E) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::CharSpan value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.CharString response", value); - } -}; - -class WriteTestClusterCharString : public ModelCommand -{ -public: - WriteTestClusterCharString() : ModelCommand("write") - { - AddArgument("attr-name", "char-string"); - AddArgument("attr-value", &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterCharString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000001E) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::CharSpan mValue; -}; - -class ReportTestClusterCharString : public ModelCommand -{ -public: - ReportTestClusterCharString() : ModelCommand("subscribe") - { - AddArgument("attr-name", "char-string"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterCharString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000001E) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::CharSpan value) - { - DataModelLogger::LogValue("TestCluster.CharString report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute LongCharString - */ -class ReadTestClusterLongCharString : public ModelCommand -{ -public: - ReadTestClusterLongCharString() : ModelCommand("read") - { - AddArgument("attr-name", "long-char-string"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterLongCharString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000001F) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::CharSpan value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.LongCharString response", value); - } -}; - -class WriteTestClusterLongCharString : public ModelCommand -{ -public: - WriteTestClusterLongCharString() : ModelCommand("write") - { - AddArgument("attr-name", "long-char-string"); - AddArgument("attr-value", &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterLongCharString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000001F) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::CharSpan mValue; -}; - -class ReportTestClusterLongCharString : public ModelCommand -{ -public: - ReportTestClusterLongCharString() : ModelCommand("subscribe") - { - AddArgument("attr-name", "long-char-string"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterLongCharString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000001F) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::CharSpan value) - { - DataModelLogger::LogValue("TestCluster.LongCharString report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute EpochUs - */ -class ReadTestClusterEpochUs : public ModelCommand -{ -public: - ReadTestClusterEpochUs() : ModelCommand("read") - { - AddArgument("attr-name", "epoch-us"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterEpochUs() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000020) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint64_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.EpochUs response", value); - } -}; - -class WriteTestClusterEpochUs : public ModelCommand -{ -public: - WriteTestClusterEpochUs() : ModelCommand("write") - { - AddArgument("attr-name", "epoch-us"); - AddArgument("attr-value", 0, UINT64_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterEpochUs() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000020) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint64_t mValue; -}; - -class ReportTestClusterEpochUs : public ModelCommand -{ -public: - ReportTestClusterEpochUs() : ModelCommand("subscribe") - { - AddArgument("attr-name", "epoch-us"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterEpochUs() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000020) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint64_t value) { DataModelLogger::LogValue("TestCluster.EpochUs report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute EpochS - */ -class ReadTestClusterEpochS : public ModelCommand -{ -public: - ReadTestClusterEpochS() : ModelCommand("read") - { - AddArgument("attr-name", "epoch-s"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterEpochS() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000021) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint32_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.EpochS response", value); - } -}; - -class WriteTestClusterEpochS : public ModelCommand -{ -public: - WriteTestClusterEpochS() : ModelCommand("write") - { - AddArgument("attr-name", "epoch-s"); - AddArgument("attr-value", 0, UINT32_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterEpochS() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000021) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint32_t mValue; -}; - -class ReportTestClusterEpochS : public ModelCommand -{ -public: - ReportTestClusterEpochS() : ModelCommand("subscribe") - { - AddArgument("attr-name", "epoch-s"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterEpochS() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000021) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint32_t value) { DataModelLogger::LogValue("TestCluster.EpochS report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute VendorId - */ -class ReadTestClusterVendorId : public ModelCommand -{ -public: - ReadTestClusterVendorId() : ModelCommand("read") - { - AddArgument("attr-name", "vendor-id"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterVendorId() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000022) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::VendorId value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.VendorId response", value); - } -}; - -class WriteTestClusterVendorId : public ModelCommand -{ -public: - WriteTestClusterVendorId() : ModelCommand("write") - { - AddArgument("attr-name", "vendor-id"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterVendorId() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000022) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::VendorId mValue; -}; - -class ReportTestClusterVendorId : public ModelCommand -{ -public: - ReportTestClusterVendorId() : ModelCommand("subscribe") - { - AddArgument("attr-name", "vendor-id"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterVendorId() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000022) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::VendorId value) - { - DataModelLogger::LogValue("TestCluster.VendorId report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ListNullablesAndOptionalsStruct - */ -class ReadTestClusterListNullablesAndOptionalsStruct : public ModelCommand -{ -public: - ReadTestClusterListNullablesAndOptionalsStruct() : ModelCommand("read") - { - AddArgument("attr-name", "list-nullables-and-optionals-struct"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterListNullablesAndOptionalsStruct() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000023) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void - OnAttributeResponse(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::TestCluster::Structs::NullablesAndOptionalsStruct::DecodableType> & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.ListNullablesAndOptionalsStruct response", value); - } -}; - -class WriteTestClusterListNullablesAndOptionalsStruct : public ModelCommand -{ -public: - WriteTestClusterListNullablesAndOptionalsStruct() : ModelCommand("write"), mComplex(&mValue) - { - AddArgument("attr-name", "list-nullables-and-optionals-struct"); - AddArgument("attr-value", &mComplex); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterListNullablesAndOptionalsStruct() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000023) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::List mValue; - TypedComplexArgument< - chip::app::DataModel::List> - mComplex; -}; - -class ReportTestClusterListNullablesAndOptionalsStruct : public ModelCommand -{ -public: - ReportTestClusterListNullablesAndOptionalsStruct() : ModelCommand("subscribe") - { - AddArgument("attr-name", "list-nullables-and-optionals-struct"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterListNullablesAndOptionalsStruct() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000023) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::TestCluster::Structs::NullablesAndOptionalsStruct::DecodableType> & value) - { - DataModelLogger::LogValue("TestCluster.ListNullablesAndOptionalsStruct report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute EnumAttr - */ -class ReadTestClusterEnumAttr : public ModelCommand -{ -public: - ReadTestClusterEnumAttr() : ModelCommand("read") - { - AddArgument("attr-name", "enum-attr"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterEnumAttr() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000024) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, chip::app::Clusters::TestCluster::SimpleEnum value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.EnumAttr response", value); - } -}; - -class WriteTestClusterEnumAttr : public ModelCommand -{ -public: - WriteTestClusterEnumAttr() : ModelCommand("write") - { - AddArgument("attr-name", "enum-attr"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterEnumAttr() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000024) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::TestCluster::SimpleEnum mValue; -}; - -class ReportTestClusterEnumAttr : public ModelCommand -{ -public: - ReportTestClusterEnumAttr() : ModelCommand("subscribe") - { - AddArgument("attr-name", "enum-attr"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterEnumAttr() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000024) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, chip::app::Clusters::TestCluster::SimpleEnum value) - { - DataModelLogger::LogValue("TestCluster.EnumAttr report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute RangeRestrictedInt8u - */ -class ReadTestClusterRangeRestrictedInt8u : public ModelCommand -{ -public: - ReadTestClusterRangeRestrictedInt8u() : ModelCommand("read") - { - AddArgument("attr-name", "range-restricted-int8u"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterRangeRestrictedInt8u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000026) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.RangeRestrictedInt8u response", value); - } -}; - -class WriteTestClusterRangeRestrictedInt8u : public ModelCommand -{ -public: - WriteTestClusterRangeRestrictedInt8u() : ModelCommand("write") - { - AddArgument("attr-name", "range-restricted-int8u"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterRangeRestrictedInt8u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000026) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint8_t mValue; -}; - -class ReportTestClusterRangeRestrictedInt8u : public ModelCommand -{ -public: - ReportTestClusterRangeRestrictedInt8u() : ModelCommand("subscribe") - { - AddArgument("attr-name", "range-restricted-int8u"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterRangeRestrictedInt8u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000026) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("TestCluster.RangeRestrictedInt8u report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute RangeRestrictedInt8s - */ -class ReadTestClusterRangeRestrictedInt8s : public ModelCommand -{ -public: - ReadTestClusterRangeRestrictedInt8s() : ModelCommand("read") - { - AddArgument("attr-name", "range-restricted-int8s"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterRangeRestrictedInt8s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000027) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int8_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.RangeRestrictedInt8s response", value); - } -}; - -class WriteTestClusterRangeRestrictedInt8s : public ModelCommand -{ -public: - WriteTestClusterRangeRestrictedInt8s() : ModelCommand("write") - { - AddArgument("attr-name", "range-restricted-int8s"); - AddArgument("attr-value", INT8_MIN, INT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterRangeRestrictedInt8s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000027) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - int8_t mValue; -}; - -class ReportTestClusterRangeRestrictedInt8s : public ModelCommand -{ -public: - ReportTestClusterRangeRestrictedInt8s() : ModelCommand("subscribe") - { - AddArgument("attr-name", "range-restricted-int8s"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterRangeRestrictedInt8s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000027) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int8_t value) - { - DataModelLogger::LogValue("TestCluster.RangeRestrictedInt8s report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute RangeRestrictedInt16u - */ -class ReadTestClusterRangeRestrictedInt16u : public ModelCommand -{ -public: - ReadTestClusterRangeRestrictedInt16u() : ModelCommand("read") - { - AddArgument("attr-name", "range-restricted-int16u"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterRangeRestrictedInt16u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000028) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.RangeRestrictedInt16u response", value); - } -}; - -class WriteTestClusterRangeRestrictedInt16u : public ModelCommand -{ -public: - WriteTestClusterRangeRestrictedInt16u() : ModelCommand("write") - { - AddArgument("attr-name", "range-restricted-int16u"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterRangeRestrictedInt16u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000028) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint16_t mValue; -}; - -class ReportTestClusterRangeRestrictedInt16u : public ModelCommand -{ -public: - ReportTestClusterRangeRestrictedInt16u() : ModelCommand("subscribe") - { - AddArgument("attr-name", "range-restricted-int16u"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterRangeRestrictedInt16u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000028) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("TestCluster.RangeRestrictedInt16u report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute RangeRestrictedInt16s - */ -class ReadTestClusterRangeRestrictedInt16s : public ModelCommand -{ -public: - ReadTestClusterRangeRestrictedInt16s() : ModelCommand("read") - { - AddArgument("attr-name", "range-restricted-int16s"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterRangeRestrictedInt16s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000029) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.RangeRestrictedInt16s response", value); - } -}; - -class WriteTestClusterRangeRestrictedInt16s : public ModelCommand -{ -public: - WriteTestClusterRangeRestrictedInt16s() : ModelCommand("write") - { - AddArgument("attr-name", "range-restricted-int16s"); - AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterRangeRestrictedInt16s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000029) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - int16_t mValue; -}; - -class ReportTestClusterRangeRestrictedInt16s : public ModelCommand -{ -public: - ReportTestClusterRangeRestrictedInt16s() : ModelCommand("subscribe") - { - AddArgument("attr-name", "range-restricted-int16s"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterRangeRestrictedInt16s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000029) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("TestCluster.RangeRestrictedInt16s report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ListLongOctetString - */ -class ReadTestClusterListLongOctetString : public ModelCommand -{ -public: - ReadTestClusterListLongOctetString() : ModelCommand("read") - { - AddArgument("attr-name", "list-long-octet-string"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterListLongOctetString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000002A) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.ListLongOctetString response", value); - } -}; - -class ReportTestClusterListLongOctetString : public ModelCommand -{ -public: - ReportTestClusterListLongOctetString() : ModelCommand("subscribe") - { - AddArgument("attr-name", "list-long-octet-string"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterListLongOctetString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000002A) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("TestCluster.ListLongOctetString report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute TimedWriteBoolean - */ -class ReadTestClusterTimedWriteBoolean : public ModelCommand -{ -public: - ReadTestClusterTimedWriteBoolean() : ModelCommand("read") - { - AddArgument("attr-name", "timed-write-boolean"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterTimedWriteBoolean() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000030) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, bool value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.TimedWriteBoolean response", value); - } -}; - -class WriteTestClusterTimedWriteBoolean : public ModelCommand -{ -public: - WriteTestClusterTimedWriteBoolean() : ModelCommand("write") - { - AddArgument("attr-name", "timed-write-boolean"); - AddArgument("attr-value", 0, 1, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterTimedWriteBoolean() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000030) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - bool mValue; -}; - -class ReportTestClusterTimedWriteBoolean : public ModelCommand -{ -public: - ReportTestClusterTimedWriteBoolean() : ModelCommand("subscribe") - { - AddArgument("attr-name", "timed-write-boolean"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterTimedWriteBoolean() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000030) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, bool value) - { - DataModelLogger::LogValue("TestCluster.TimedWriteBoolean report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute GeneralErrorBoolean - */ -class ReadTestClusterGeneralErrorBoolean : public ModelCommand -{ -public: - ReadTestClusterGeneralErrorBoolean() : ModelCommand("read") - { - AddArgument("attr-name", "general-error-boolean"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterGeneralErrorBoolean() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000031) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, bool value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.GeneralErrorBoolean response", value); - } -}; - -class WriteTestClusterGeneralErrorBoolean : public ModelCommand -{ -public: - WriteTestClusterGeneralErrorBoolean() : ModelCommand("write") - { - AddArgument("attr-name", "general-error-boolean"); - AddArgument("attr-value", 0, 1, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterGeneralErrorBoolean() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000031) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - bool mValue; -}; - -class ReportTestClusterGeneralErrorBoolean : public ModelCommand -{ -public: - ReportTestClusterGeneralErrorBoolean() : ModelCommand("subscribe") - { - AddArgument("attr-name", "general-error-boolean"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterGeneralErrorBoolean() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000031) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, bool value) - { - DataModelLogger::LogValue("TestCluster.GeneralErrorBoolean report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterErrorBoolean - */ -class ReadTestClusterClusterErrorBoolean : public ModelCommand -{ -public: - ReadTestClusterClusterErrorBoolean() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-error-boolean"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterClusterErrorBoolean() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00000032) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, bool value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.ClusterErrorBoolean response", value); - } -}; - -class WriteTestClusterClusterErrorBoolean : public ModelCommand -{ -public: - WriteTestClusterClusterErrorBoolean() : ModelCommand("write") - { - AddArgument("attr-name", "cluster-error-boolean"); - AddArgument("attr-value", 0, 1, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterClusterErrorBoolean() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00000032) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - bool mValue; -}; - -class ReportTestClusterClusterErrorBoolean : public ModelCommand -{ -public: - ReportTestClusterClusterErrorBoolean() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-error-boolean"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterClusterErrorBoolean() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00000032) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, bool value) - { - DataModelLogger::LogValue("TestCluster.ClusterErrorBoolean report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute Unsupported - */ -class ReadTestClusterUnsupported : public ModelCommand -{ -public: - ReadTestClusterUnsupported() : ModelCommand("read") - { - AddArgument("attr-name", "unsupported"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterUnsupported() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x000000FF) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, bool value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.Unsupported response", value); - } -}; - -class WriteTestClusterUnsupported : public ModelCommand -{ -public: - WriteTestClusterUnsupported() : ModelCommand("write") - { - AddArgument("attr-name", "unsupported"); - AddArgument("attr-value", 0, 1, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterUnsupported() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x000000FF) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - bool mValue; -}; - -class ReportTestClusterUnsupported : public ModelCommand -{ -public: - ReportTestClusterUnsupported() : ModelCommand("subscribe") - { - AddArgument("attr-name", "unsupported"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterUnsupported() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x000000FF) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, bool value) { DataModelLogger::LogValue("TestCluster.Unsupported report", 0, value); } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableBoolean - */ -class ReadTestClusterNullableBoolean : public ModelCommand -{ -public: - ReadTestClusterNullableBoolean() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-boolean"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableBoolean() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00008000) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableBoolean response", value); - } -}; - -class WriteTestClusterNullableBoolean : public ModelCommand -{ -public: - WriteTestClusterNullableBoolean() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-boolean"); - AddArgument("attr-value", 0, 1, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableBoolean() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008000) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableBoolean : public ModelCommand -{ -public: - ReportTestClusterNullableBoolean() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-boolean"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableBoolean() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00008000) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableBoolean report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableBitmap8 - */ -class ReadTestClusterNullableBitmap8 : public ModelCommand -{ -public: - ReadTestClusterNullableBitmap8() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-bitmap8"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableBitmap8() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00008001) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableBitmap8 response", value); - } -}; - -class WriteTestClusterNullableBitmap8 : public ModelCommand -{ -public: - WriteTestClusterNullableBitmap8() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-bitmap8"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableBitmap8() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008001) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableBitmap8 : public ModelCommand -{ -public: - ReportTestClusterNullableBitmap8() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-bitmap8"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableBitmap8() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00008001) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableBitmap8 report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableBitmap16 - */ -class ReadTestClusterNullableBitmap16 : public ModelCommand -{ -public: - ReadTestClusterNullableBitmap16() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-bitmap16"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableBitmap16() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00008002) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableBitmap16 response", value); - } -}; - -class WriteTestClusterNullableBitmap16 : public ModelCommand -{ -public: - WriteTestClusterNullableBitmap16() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-bitmap16"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableBitmap16() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008002) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableBitmap16 : public ModelCommand -{ -public: - ReportTestClusterNullableBitmap16() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-bitmap16"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableBitmap16() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00008002) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableBitmap16 report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableBitmap32 - */ -class ReadTestClusterNullableBitmap32 : public ModelCommand -{ -public: - ReadTestClusterNullableBitmap32() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-bitmap32"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableBitmap32() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00008003) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableBitmap32 response", value); - } -}; - -class WriteTestClusterNullableBitmap32 : public ModelCommand -{ -public: - WriteTestClusterNullableBitmap32() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-bitmap32"); - AddArgument("attr-value", 0, UINT32_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableBitmap32() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008003) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableBitmap32 : public ModelCommand -{ -public: - ReportTestClusterNullableBitmap32() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-bitmap32"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableBitmap32() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00008003) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableBitmap32 report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableBitmap64 - */ -class ReadTestClusterNullableBitmap64 : public ModelCommand -{ -public: - ReadTestClusterNullableBitmap64() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-bitmap64"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableBitmap64() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00008004) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableBitmap64 response", value); - } -}; - -class WriteTestClusterNullableBitmap64 : public ModelCommand -{ -public: - WriteTestClusterNullableBitmap64() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-bitmap64"); - AddArgument("attr-value", 0, UINT64_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableBitmap64() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008004) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableBitmap64 : public ModelCommand -{ -public: - ReportTestClusterNullableBitmap64() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-bitmap64"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableBitmap64() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00008004) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableBitmap64 report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableInt8u - */ -class ReadTestClusterNullableInt8u : public ModelCommand -{ -public: - ReadTestClusterNullableInt8u() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-int8u"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableInt8u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00008005) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableInt8u response", value); - } -}; - -class WriteTestClusterNullableInt8u : public ModelCommand -{ -public: - WriteTestClusterNullableInt8u() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-int8u"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableInt8u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008005) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableInt8u : public ModelCommand -{ -public: - ReportTestClusterNullableInt8u() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-int8u"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableInt8u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00008005) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableInt8u report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableInt16u - */ -class ReadTestClusterNullableInt16u : public ModelCommand -{ -public: - ReadTestClusterNullableInt16u() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-int16u"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableInt16u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00008006) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableInt16u response", value); - } -}; - -class WriteTestClusterNullableInt16u : public ModelCommand -{ -public: - WriteTestClusterNullableInt16u() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-int16u"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableInt16u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008006) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableInt16u : public ModelCommand -{ -public: - ReportTestClusterNullableInt16u() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-int16u"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableInt16u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00008006) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableInt16u report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableInt24u - */ -class ReadTestClusterNullableInt24u : public ModelCommand -{ -public: - ReadTestClusterNullableInt24u() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-int24u"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableInt24u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00008007) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableInt24u response", value); - } -}; - -class WriteTestClusterNullableInt24u : public ModelCommand -{ -public: - WriteTestClusterNullableInt24u() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-int24u"); - AddArgument("attr-value", 0, UINT32_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableInt24u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008007) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableInt24u : public ModelCommand -{ -public: - ReportTestClusterNullableInt24u() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-int24u"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableInt24u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00008007) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableInt24u report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableInt32u - */ -class ReadTestClusterNullableInt32u : public ModelCommand -{ -public: - ReadTestClusterNullableInt32u() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-int32u"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableInt32u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00008008) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableInt32u response", value); - } -}; - -class WriteTestClusterNullableInt32u : public ModelCommand -{ -public: - WriteTestClusterNullableInt32u() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-int32u"); - AddArgument("attr-value", 0, UINT32_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableInt32u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008008) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableInt32u : public ModelCommand -{ -public: - ReportTestClusterNullableInt32u() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-int32u"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableInt32u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00008008) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableInt32u report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableInt40u - */ -class ReadTestClusterNullableInt40u : public ModelCommand -{ -public: - ReadTestClusterNullableInt40u() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-int40u"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableInt40u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00008009) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableInt40u response", value); - } -}; - -class WriteTestClusterNullableInt40u : public ModelCommand -{ -public: - WriteTestClusterNullableInt40u() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-int40u"); - AddArgument("attr-value", 0, UINT64_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableInt40u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008009) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableInt40u : public ModelCommand -{ -public: - ReportTestClusterNullableInt40u() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-int40u"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableInt40u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00008009) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableInt40u report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableInt48u - */ -class ReadTestClusterNullableInt48u : public ModelCommand -{ -public: - ReadTestClusterNullableInt48u() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-int48u"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableInt48u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000800A) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableInt48u response", value); - } -}; - -class WriteTestClusterNullableInt48u : public ModelCommand -{ -public: - WriteTestClusterNullableInt48u() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-int48u"); - AddArgument("attr-value", 0, UINT64_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableInt48u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000800A) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableInt48u : public ModelCommand -{ -public: - ReportTestClusterNullableInt48u() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-int48u"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableInt48u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000800A) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableInt48u report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableInt56u - */ -class ReadTestClusterNullableInt56u : public ModelCommand -{ -public: - ReadTestClusterNullableInt56u() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-int56u"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableInt56u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000800B) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableInt56u response", value); - } -}; - -class WriteTestClusterNullableInt56u : public ModelCommand -{ -public: - WriteTestClusterNullableInt56u() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-int56u"); - AddArgument("attr-value", 0, UINT64_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableInt56u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000800B) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableInt56u : public ModelCommand -{ -public: - ReportTestClusterNullableInt56u() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-int56u"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableInt56u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000800B) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableInt56u report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableInt64u - */ -class ReadTestClusterNullableInt64u : public ModelCommand -{ -public: - ReadTestClusterNullableInt64u() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-int64u"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableInt64u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000800C) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableInt64u response", value); - } -}; - -class WriteTestClusterNullableInt64u : public ModelCommand -{ -public: - WriteTestClusterNullableInt64u() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-int64u"); - AddArgument("attr-value", 0, UINT64_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableInt64u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000800C) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableInt64u : public ModelCommand -{ -public: - ReportTestClusterNullableInt64u() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-int64u"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableInt64u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000800C) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableInt64u report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableInt8s - */ -class ReadTestClusterNullableInt8s : public ModelCommand -{ -public: - ReadTestClusterNullableInt8s() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-int8s"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableInt8s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000800D) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableInt8s response", value); - } -}; - -class WriteTestClusterNullableInt8s : public ModelCommand -{ -public: - WriteTestClusterNullableInt8s() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-int8s"); - AddArgument("attr-value", INT8_MIN, INT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableInt8s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000800D) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableInt8s : public ModelCommand -{ -public: - ReportTestClusterNullableInt8s() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-int8s"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableInt8s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000800D) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableInt8s report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableInt16s - */ -class ReadTestClusterNullableInt16s : public ModelCommand -{ -public: - ReadTestClusterNullableInt16s() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-int16s"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableInt16s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000800E) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableInt16s response", value); - } -}; - -class WriteTestClusterNullableInt16s : public ModelCommand -{ -public: - WriteTestClusterNullableInt16s() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-int16s"); - AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableInt16s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000800E) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableInt16s : public ModelCommand -{ -public: - ReportTestClusterNullableInt16s() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-int16s"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableInt16s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000800E) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableInt16s report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableInt24s - */ -class ReadTestClusterNullableInt24s : public ModelCommand -{ -public: - ReadTestClusterNullableInt24s() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-int24s"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableInt24s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000800F) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableInt24s response", value); - } -}; - -class WriteTestClusterNullableInt24s : public ModelCommand -{ -public: - WriteTestClusterNullableInt24s() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-int24s"); - AddArgument("attr-value", INT32_MIN, INT32_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableInt24s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000800F) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableInt24s : public ModelCommand -{ -public: - ReportTestClusterNullableInt24s() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-int24s"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableInt24s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000800F) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableInt24s report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableInt32s - */ -class ReadTestClusterNullableInt32s : public ModelCommand -{ -public: - ReadTestClusterNullableInt32s() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-int32s"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableInt32s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00008010) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableInt32s response", value); - } -}; - -class WriteTestClusterNullableInt32s : public ModelCommand -{ -public: - WriteTestClusterNullableInt32s() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-int32s"); - AddArgument("attr-value", INT32_MIN, INT32_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableInt32s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008010) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableInt32s : public ModelCommand -{ -public: - ReportTestClusterNullableInt32s() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-int32s"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableInt32s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00008010) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableInt32s report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableInt40s - */ -class ReadTestClusterNullableInt40s : public ModelCommand -{ -public: - ReadTestClusterNullableInt40s() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-int40s"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableInt40s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00008011) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableInt40s response", value); - } -}; - -class WriteTestClusterNullableInt40s : public ModelCommand -{ -public: - WriteTestClusterNullableInt40s() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-int40s"); - AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableInt40s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008011) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableInt40s : public ModelCommand -{ -public: - ReportTestClusterNullableInt40s() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-int40s"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableInt40s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00008011) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableInt40s report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableInt48s - */ -class ReadTestClusterNullableInt48s : public ModelCommand -{ -public: - ReadTestClusterNullableInt48s() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-int48s"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableInt48s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00008012) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableInt48s response", value); - } -}; - -class WriteTestClusterNullableInt48s : public ModelCommand -{ -public: - WriteTestClusterNullableInt48s() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-int48s"); - AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableInt48s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008012) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableInt48s : public ModelCommand -{ -public: - ReportTestClusterNullableInt48s() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-int48s"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableInt48s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00008012) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableInt48s report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableInt56s - */ -class ReadTestClusterNullableInt56s : public ModelCommand -{ -public: - ReadTestClusterNullableInt56s() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-int56s"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableInt56s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00008013) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableInt56s response", value); - } -}; - -class WriteTestClusterNullableInt56s : public ModelCommand -{ -public: - WriteTestClusterNullableInt56s() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-int56s"); - AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableInt56s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008013) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableInt56s : public ModelCommand -{ -public: - ReportTestClusterNullableInt56s() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-int56s"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableInt56s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00008013) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableInt56s report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableInt64s - */ -class ReadTestClusterNullableInt64s : public ModelCommand -{ -public: - ReadTestClusterNullableInt64s() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-int64s"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableInt64s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00008014) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableInt64s response", value); - } -}; - -class WriteTestClusterNullableInt64s : public ModelCommand -{ -public: - WriteTestClusterNullableInt64s() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-int64s"); - AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableInt64s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008014) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableInt64s : public ModelCommand -{ -public: - ReportTestClusterNullableInt64s() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-int64s"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableInt64s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00008014) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableInt64s report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableEnum8 - */ -class ReadTestClusterNullableEnum8 : public ModelCommand -{ -public: - ReadTestClusterNullableEnum8() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-enum8"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableEnum8() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00008015) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableEnum8 response", value); - } -}; - -class WriteTestClusterNullableEnum8 : public ModelCommand -{ -public: - WriteTestClusterNullableEnum8() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-enum8"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableEnum8() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008015) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableEnum8 : public ModelCommand -{ -public: - ReportTestClusterNullableEnum8() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-enum8"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableEnum8() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00008015) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableEnum8 report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableEnum16 - */ -class ReadTestClusterNullableEnum16 : public ModelCommand -{ -public: - ReadTestClusterNullableEnum16() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-enum16"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableEnum16() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00008016) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableEnum16 response", value); - } -}; - -class WriteTestClusterNullableEnum16 : public ModelCommand -{ -public: - WriteTestClusterNullableEnum16() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-enum16"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableEnum16() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008016) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableEnum16 : public ModelCommand -{ -public: - ReportTestClusterNullableEnum16() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-enum16"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableEnum16() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00008016) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableEnum16 report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableFloatSingle - */ -class ReadTestClusterNullableFloatSingle : public ModelCommand -{ -public: - ReadTestClusterNullableFloatSingle() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-float-single"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableFloatSingle() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00008017) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableFloatSingle response", value); - } -}; - -class WriteTestClusterNullableFloatSingle : public ModelCommand -{ -public: - WriteTestClusterNullableFloatSingle() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-float-single"); - AddArgument("attr-value", -std::numeric_limits::infinity(), std::numeric_limits::infinity(), &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableFloatSingle() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008017) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableFloatSingle : public ModelCommand -{ -public: - ReportTestClusterNullableFloatSingle() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-float-single"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableFloatSingle() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00008017) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableFloatSingle report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableFloatDouble - */ -class ReadTestClusterNullableFloatDouble : public ModelCommand -{ -public: - ReadTestClusterNullableFloatDouble() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-float-double"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableFloatDouble() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00008018) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableFloatDouble response", value); - } -}; - -class WriteTestClusterNullableFloatDouble : public ModelCommand -{ -public: - WriteTestClusterNullableFloatDouble() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-float-double"); - AddArgument("attr-value", -std::numeric_limits::infinity(), std::numeric_limits::infinity(), &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableFloatDouble() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008018) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableFloatDouble : public ModelCommand -{ -public: - ReportTestClusterNullableFloatDouble() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-float-double"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableFloatDouble() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00008018) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableFloatDouble report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableOctetString - */ -class ReadTestClusterNullableOctetString : public ModelCommand -{ -public: - ReadTestClusterNullableOctetString() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-octet-string"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableOctetString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00008019) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableOctetString response", value); - } -}; - -class WriteTestClusterNullableOctetString : public ModelCommand -{ -public: - WriteTestClusterNullableOctetString() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-octet-string"); - AddArgument("attr-value", &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableOctetString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008019) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableOctetString : public ModelCommand -{ -public: - ReportTestClusterNullableOctetString() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-octet-string"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableOctetString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00008019) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableOctetString report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableCharString - */ -class ReadTestClusterNullableCharString : public ModelCommand -{ -public: - ReadTestClusterNullableCharString() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-char-string"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableCharString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000801E) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableCharString response", value); - } -}; - -class WriteTestClusterNullableCharString : public ModelCommand -{ -public: - WriteTestClusterNullableCharString() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-char-string"); - AddArgument("attr-value", &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableCharString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x0000801E) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableCharString : public ModelCommand -{ -public: - ReportTestClusterNullableCharString() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-char-string"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableCharString() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000801E) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableCharString report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableEnumAttr - */ -class ReadTestClusterNullableEnumAttr : public ModelCommand -{ -public: - ReadTestClusterNullableEnumAttr() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-enum-attr"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableEnumAttr() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00008024) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, - const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableEnumAttr response", value); - } -}; - -class WriteTestClusterNullableEnumAttr : public ModelCommand -{ -public: - WriteTestClusterNullableEnumAttr() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-enum-attr"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableEnumAttr() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008024) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableEnumAttr : public ModelCommand -{ -public: - ReportTestClusterNullableEnumAttr() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-enum-attr"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableEnumAttr() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00008024) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, - const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableEnumAttr report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableRangeRestrictedInt8u - */ -class ReadTestClusterNullableRangeRestrictedInt8u : public ModelCommand -{ -public: - ReadTestClusterNullableRangeRestrictedInt8u() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-range-restricted-int8u"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableRangeRestrictedInt8u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00008026) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableRangeRestrictedInt8u response", value); - } -}; - -class WriteTestClusterNullableRangeRestrictedInt8u : public ModelCommand -{ -public: - WriteTestClusterNullableRangeRestrictedInt8u() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-range-restricted-int8u"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableRangeRestrictedInt8u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008026) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableRangeRestrictedInt8u : public ModelCommand -{ -public: - ReportTestClusterNullableRangeRestrictedInt8u() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-range-restricted-int8u"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableRangeRestrictedInt8u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00008026) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableRangeRestrictedInt8u report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableRangeRestrictedInt8s - */ -class ReadTestClusterNullableRangeRestrictedInt8s : public ModelCommand -{ -public: - ReadTestClusterNullableRangeRestrictedInt8s() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-range-restricted-int8s"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableRangeRestrictedInt8s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00008027) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableRangeRestrictedInt8s response", value); - } -}; - -class WriteTestClusterNullableRangeRestrictedInt8s : public ModelCommand -{ -public: - WriteTestClusterNullableRangeRestrictedInt8s() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-range-restricted-int8s"); - AddArgument("attr-value", INT8_MIN, INT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableRangeRestrictedInt8s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008027) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableRangeRestrictedInt8s : public ModelCommand -{ -public: - ReportTestClusterNullableRangeRestrictedInt8s() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-range-restricted-int8s"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableRangeRestrictedInt8s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00008027) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableRangeRestrictedInt8s report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableRangeRestrictedInt16u - */ -class ReadTestClusterNullableRangeRestrictedInt16u : public ModelCommand -{ -public: - ReadTestClusterNullableRangeRestrictedInt16u() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-range-restricted-int16u"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableRangeRestrictedInt16u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00008028) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableRangeRestrictedInt16u response", value); - } -}; - -class WriteTestClusterNullableRangeRestrictedInt16u : public ModelCommand -{ -public: - WriteTestClusterNullableRangeRestrictedInt16u() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-range-restricted-int16u"); - AddArgument("attr-value", 0, UINT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableRangeRestrictedInt16u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008028) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableRangeRestrictedInt16u : public ModelCommand -{ -public: - ReportTestClusterNullableRangeRestrictedInt16u() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-range-restricted-int16u"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableRangeRestrictedInt16u() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00008028) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableRangeRestrictedInt16u report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NullableRangeRestrictedInt16s - */ -class ReadTestClusterNullableRangeRestrictedInt16s : public ModelCommand -{ -public: - ReadTestClusterNullableRangeRestrictedInt16s() : ModelCommand("read") - { - AddArgument("attr-name", "nullable-range-restricted-int16s"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterNullableRangeRestrictedInt16s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x00008029) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.NullableRangeRestrictedInt16s response", value); - } -}; - -class WriteTestClusterNullableRangeRestrictedInt16s : public ModelCommand -{ -public: - WriteTestClusterNullableRangeRestrictedInt16s() : ModelCommand("write") - { - AddArgument("attr-name", "nullable-range-restricted-int16s"); - AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteTestClusterNullableRangeRestrictedInt16s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) WriteAttribute (0x00008029) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class ReportTestClusterNullableRangeRestrictedInt16s : public ModelCommand -{ -public: - ReportTestClusterNullableRangeRestrictedInt16s() : ModelCommand("subscribe") - { - AddArgument("attr-name", "nullable-range-restricted-int16s"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterNullableRangeRestrictedInt16s() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x00008029) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) - { - DataModelLogger::LogValue("TestCluster.NullableRangeRestrictedInt16s report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadTestClusterAttributeList : public ModelCommand -{ -public: - ReadTestClusterAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.AttributeList response", value); - } -}; - -class ReportTestClusterAttributeList : public ModelCommand -{ -public: - ReportTestClusterAttributeList() : ModelCommand("subscribe") - { - AddArgument("attr-name", "attribute-list"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000FFFB) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) - { - DataModelLogger::LogValue("TestCluster.AttributeList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ClusterRevision - */ -class ReadTestClusterClusterRevision : public ModelCommand -{ -public: - ReadTestClusterClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadTestClusterClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReadAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeEventResponse(context, "TestCluster.ClusterRevision response", value); - } -}; - -class ReportTestClusterClusterRevision : public ModelCommand -{ -public: - ReportTestClusterClusterRevision() : ModelCommand("subscribe") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTestClusterClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050F) ReportAttribute (0x0000FFFD) on endpoint %" PRIu16, endpointId); - - chip::Controller::TestClusterCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint16_t value) - { - DataModelLogger::LogValue("TestCluster.ClusterRevision report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/*----------------------------------------------------------------------------*\ -| Cluster Thermostat | 0x0201 | -|------------------------------------------------------------------------------| -| Commands: | | -| * ClearWeeklySchedule | 0x03 | -| * GetRelayStatusLog | 0x04 | -| * GetWeeklySchedule | 0x02 | -| * SetWeeklySchedule | 0x01 | -| * SetpointRaiseLower | 0x00 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * LocalTemperature | 0x0000 | -| * AbsMinHeatSetpointLimit | 0x0003 | -| * AbsMaxHeatSetpointLimit | 0x0004 | -| * AbsMinCoolSetpointLimit | 0x0005 | -| * AbsMaxCoolSetpointLimit | 0x0006 | -| * OccupiedCoolingSetpoint | 0x0011 | -| * OccupiedHeatingSetpoint | 0x0012 | -| * MinHeatSetpointLimit | 0x0015 | -| * MaxHeatSetpointLimit | 0x0016 | -| * MinCoolSetpointLimit | 0x0017 | -| * MaxCoolSetpointLimit | 0x0018 | -| * MinSetpointDeadBand | 0x0019 | -| * ControlSequenceOfOperation | 0x001B | -| * SystemMode | 0x001C | -| * StartOfWeek | 0x0020 | -| * NumberOfWeeklyTransitions | 0x0021 | -| * NumberOfDailyTransitions | 0x0022 | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command ClearWeeklySchedule - */ -class ThermostatClearWeeklySchedule : public ModelCommand -{ -public: - ThermostatClearWeeklySchedule() : ModelCommand("clear-weekly-schedule") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) command (0x00000003) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Thermostat::Commands::ClearWeeklySchedule::Type mRequest; -}; - -/* - * Command GetRelayStatusLog - */ -class ThermostatGetRelayStatusLog : public ModelCommand -{ -public: - ThermostatGetRelayStatusLog() : ModelCommand("get-relay-status-log") { ModelCommand::AddArguments(); } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) command (0x00000004) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnThermostatGetRelayStatusLogResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Thermostat::Commands::GetRelayStatusLog::Type mRequest; -}; - -/* - * Command GetWeeklySchedule - */ -class ThermostatGetWeeklySchedule : public ModelCommand -{ -public: - ThermostatGetWeeklySchedule() : ModelCommand("get-weekly-schedule") - { - AddArgument("DaysToReturn", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.daysToReturn)); - AddArgument( - "ModeToReturn", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.modeToReturn)); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) command (0x00000002) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnThermostatGetWeeklyScheduleResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Thermostat::Commands::GetWeeklySchedule::Type mRequest; -}; - -/* - * Command SetWeeklySchedule - */ -class ThermostatSetWeeklySchedule : public ModelCommand -{ -public: - ThermostatSetWeeklySchedule() : ModelCommand("set-weekly-schedule"), mComplex_Payload(&mRequest.payload) - { - AddArgument("NumberOfTransitionsForSequence", 0, UINT8_MAX, &mRequest.numberOfTransitionsForSequence); - AddArgument( - "DayOfWeekForSequence", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.dayOfWeekForSequence)); - AddArgument("ModeForSequence", 0, UINT8_MAX, - reinterpret_cast *>( - &mRequest.modeForSequence)); - AddArgument("Payload", &mComplex_Payload); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) command (0x00000001) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Thermostat::Commands::SetWeeklySchedule::Type mRequest; - TypedComplexArgument> mComplex_Payload; -}; - -/* - * Command SetpointRaiseLower - */ -class ThermostatSetpointRaiseLower : public ModelCommand -{ -public: - ThermostatSetpointRaiseLower() : ModelCommand("setpoint-raise-lower") - { - AddArgument("Mode", 0, UINT8_MAX, reinterpret_cast *>(&mRequest.mode)); - AddArgument("Amount", INT8_MIN, INT8_MAX, &mRequest.amount); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) command (0x00000000) on endpoint %" PRIu16, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::Thermostat::Commands::SetpointRaiseLower::Type mRequest; -}; - -/* - * Attribute LocalTemperature - */ -class ReadThermostatLocalTemperature : public ModelCommand -{ -public: - ReadThermostatLocalTemperature() : ModelCommand("read") - { - AddArgument("attr-name", "local-temperature"); - ModelCommand::AddArguments(); - } - - ~ReadThermostatLocalTemperature() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "Thermostat.LocalTemperature response", value); - } -}; - -class ReportThermostatLocalTemperature : public ModelCommand -{ -public: - ReportThermostatLocalTemperature() : ModelCommand("subscribe") - { - AddArgument("attr-name", "local-temperature"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportThermostatLocalTemperature() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000000) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("Thermostat.LocalTemperature report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AbsMinHeatSetpointLimit - */ -class ReadThermostatAbsMinHeatSetpointLimit : public ModelCommand -{ -public: - ReadThermostatAbsMinHeatSetpointLimit() : ModelCommand("read") - { - AddArgument("attr-name", "abs-min-heat-setpoint-limit"); - ModelCommand::AddArguments(); - } - - ~ReadThermostatAbsMinHeatSetpointLimit() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "Thermostat.AbsMinHeatSetpointLimit response", value); - } -}; - -class ReportThermostatAbsMinHeatSetpointLimit : public ModelCommand -{ -public: - ReportThermostatAbsMinHeatSetpointLimit() : ModelCommand("subscribe") - { - AddArgument("attr-name", "abs-min-heat-setpoint-limit"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportThermostatAbsMinHeatSetpointLimit() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000003) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("Thermostat.AbsMinHeatSetpointLimit report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AbsMaxHeatSetpointLimit - */ -class ReadThermostatAbsMaxHeatSetpointLimit : public ModelCommand -{ -public: - ReadThermostatAbsMaxHeatSetpointLimit() : ModelCommand("read") - { - AddArgument("attr-name", "abs-max-heat-setpoint-limit"); - ModelCommand::AddArguments(); - } - - ~ReadThermostatAbsMaxHeatSetpointLimit() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "Thermostat.AbsMaxHeatSetpointLimit response", value); - } -}; - -class ReportThermostatAbsMaxHeatSetpointLimit : public ModelCommand -{ -public: - ReportThermostatAbsMaxHeatSetpointLimit() : ModelCommand("subscribe") - { - AddArgument("attr-name", "abs-max-heat-setpoint-limit"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportThermostatAbsMaxHeatSetpointLimit() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000004) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("Thermostat.AbsMaxHeatSetpointLimit report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AbsMinCoolSetpointLimit - */ -class ReadThermostatAbsMinCoolSetpointLimit : public ModelCommand -{ -public: - ReadThermostatAbsMinCoolSetpointLimit() : ModelCommand("read") - { - AddArgument("attr-name", "abs-min-cool-setpoint-limit"); - ModelCommand::AddArguments(); - } - - ~ReadThermostatAbsMinCoolSetpointLimit() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "Thermostat.AbsMinCoolSetpointLimit response", value); - } -}; - -class ReportThermostatAbsMinCoolSetpointLimit : public ModelCommand -{ -public: - ReportThermostatAbsMinCoolSetpointLimit() : ModelCommand("subscribe") - { - AddArgument("attr-name", "abs-min-cool-setpoint-limit"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportThermostatAbsMinCoolSetpointLimit() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000005) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("Thermostat.AbsMinCoolSetpointLimit report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AbsMaxCoolSetpointLimit - */ -class ReadThermostatAbsMaxCoolSetpointLimit : public ModelCommand -{ -public: - ReadThermostatAbsMaxCoolSetpointLimit() : ModelCommand("read") - { - AddArgument("attr-name", "abs-max-cool-setpoint-limit"); - ModelCommand::AddArguments(); - } - - ~ReadThermostatAbsMaxCoolSetpointLimit() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "Thermostat.AbsMaxCoolSetpointLimit response", value); - } -}; - -class ReportThermostatAbsMaxCoolSetpointLimit : public ModelCommand -{ -public: - ReportThermostatAbsMaxCoolSetpointLimit() : ModelCommand("subscribe") - { - AddArgument("attr-name", "abs-max-cool-setpoint-limit"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportThermostatAbsMaxCoolSetpointLimit() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000006) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("Thermostat.AbsMaxCoolSetpointLimit report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute OccupiedCoolingSetpoint - */ -class ReadThermostatOccupiedCoolingSetpoint : public ModelCommand -{ -public: - ReadThermostatOccupiedCoolingSetpoint() : ModelCommand("read") - { - AddArgument("attr-name", "occupied-cooling-setpoint"); - ModelCommand::AddArguments(); - } - - ~ReadThermostatOccupiedCoolingSetpoint() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000011) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "Thermostat.OccupiedCoolingSetpoint response", value); - } -}; - -class WriteThermostatOccupiedCoolingSetpoint : public ModelCommand -{ -public: - WriteThermostatOccupiedCoolingSetpoint() : ModelCommand("write") - { - AddArgument("attr-name", "occupied-cooling-setpoint"); - AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteThermostatOccupiedCoolingSetpoint() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000011) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - int16_t mValue; -}; - -class ReportThermostatOccupiedCoolingSetpoint : public ModelCommand -{ -public: - ReportThermostatOccupiedCoolingSetpoint() : ModelCommand("subscribe") - { - AddArgument("attr-name", "occupied-cooling-setpoint"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportThermostatOccupiedCoolingSetpoint() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000011) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("Thermostat.OccupiedCoolingSetpoint report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute OccupiedHeatingSetpoint - */ -class ReadThermostatOccupiedHeatingSetpoint : public ModelCommand -{ -public: - ReadThermostatOccupiedHeatingSetpoint() : ModelCommand("read") - { - AddArgument("attr-name", "occupied-heating-setpoint"); - ModelCommand::AddArguments(); - } - - ~ReadThermostatOccupiedHeatingSetpoint() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000012) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "Thermostat.OccupiedHeatingSetpoint response", value); - } -}; - -class WriteThermostatOccupiedHeatingSetpoint : public ModelCommand -{ -public: - WriteThermostatOccupiedHeatingSetpoint() : ModelCommand("write") - { - AddArgument("attr-name", "occupied-heating-setpoint"); - AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteThermostatOccupiedHeatingSetpoint() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000012) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - int16_t mValue; -}; - -class ReportThermostatOccupiedHeatingSetpoint : public ModelCommand -{ -public: - ReportThermostatOccupiedHeatingSetpoint() : ModelCommand("subscribe") - { - AddArgument("attr-name", "occupied-heating-setpoint"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportThermostatOccupiedHeatingSetpoint() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000012) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("Thermostat.OccupiedHeatingSetpoint report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MinHeatSetpointLimit - */ -class ReadThermostatMinHeatSetpointLimit : public ModelCommand -{ -public: - ReadThermostatMinHeatSetpointLimit() : ModelCommand("read") - { - AddArgument("attr-name", "min-heat-setpoint-limit"); - ModelCommand::AddArguments(); - } - - ~ReadThermostatMinHeatSetpointLimit() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000015) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "Thermostat.MinHeatSetpointLimit response", value); - } -}; - -class WriteThermostatMinHeatSetpointLimit : public ModelCommand -{ -public: - WriteThermostatMinHeatSetpointLimit() : ModelCommand("write") - { - AddArgument("attr-name", "min-heat-setpoint-limit"); - AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteThermostatMinHeatSetpointLimit() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000015) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - int16_t mValue; -}; - -class ReportThermostatMinHeatSetpointLimit : public ModelCommand -{ -public: - ReportThermostatMinHeatSetpointLimit() : ModelCommand("subscribe") - { - AddArgument("attr-name", "min-heat-setpoint-limit"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportThermostatMinHeatSetpointLimit() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000015) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("Thermostat.MinHeatSetpointLimit report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MaxHeatSetpointLimit - */ -class ReadThermostatMaxHeatSetpointLimit : public ModelCommand -{ -public: - ReadThermostatMaxHeatSetpointLimit() : ModelCommand("read") - { - AddArgument("attr-name", "max-heat-setpoint-limit"); - ModelCommand::AddArguments(); - } - - ~ReadThermostatMaxHeatSetpointLimit() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000016) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "Thermostat.MaxHeatSetpointLimit response", value); - } -}; - -class WriteThermostatMaxHeatSetpointLimit : public ModelCommand -{ -public: - WriteThermostatMaxHeatSetpointLimit() : ModelCommand("write") - { - AddArgument("attr-name", "max-heat-setpoint-limit"); - AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteThermostatMaxHeatSetpointLimit() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000016) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - int16_t mValue; -}; - -class ReportThermostatMaxHeatSetpointLimit : public ModelCommand -{ -public: - ReportThermostatMaxHeatSetpointLimit() : ModelCommand("subscribe") - { - AddArgument("attr-name", "max-heat-setpoint-limit"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportThermostatMaxHeatSetpointLimit() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000016) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("Thermostat.MaxHeatSetpointLimit report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MinCoolSetpointLimit - */ -class ReadThermostatMinCoolSetpointLimit : public ModelCommand -{ -public: - ReadThermostatMinCoolSetpointLimit() : ModelCommand("read") - { - AddArgument("attr-name", "min-cool-setpoint-limit"); - ModelCommand::AddArguments(); - } - - ~ReadThermostatMinCoolSetpointLimit() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000017) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "Thermostat.MinCoolSetpointLimit response", value); - } -}; - -class WriteThermostatMinCoolSetpointLimit : public ModelCommand -{ -public: - WriteThermostatMinCoolSetpointLimit() : ModelCommand("write") - { - AddArgument("attr-name", "min-cool-setpoint-limit"); - AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteThermostatMinCoolSetpointLimit() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000017) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - int16_t mValue; -}; - -class ReportThermostatMinCoolSetpointLimit : public ModelCommand -{ -public: - ReportThermostatMinCoolSetpointLimit() : ModelCommand("subscribe") - { - AddArgument("attr-name", "min-cool-setpoint-limit"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportThermostatMinCoolSetpointLimit() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000017) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("Thermostat.MinCoolSetpointLimit report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MaxCoolSetpointLimit - */ -class ReadThermostatMaxCoolSetpointLimit : public ModelCommand -{ -public: - ReadThermostatMaxCoolSetpointLimit() : ModelCommand("read") - { - AddArgument("attr-name", "max-cool-setpoint-limit"); - ModelCommand::AddArguments(); - } - - ~ReadThermostatMaxCoolSetpointLimit() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000018) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int16_t value) - { - OnGeneralAttributeEventResponse(context, "Thermostat.MaxCoolSetpointLimit response", value); - } -}; - -class WriteThermostatMaxCoolSetpointLimit : public ModelCommand -{ -public: - WriteThermostatMaxCoolSetpointLimit() : ModelCommand("write") - { - AddArgument("attr-name", "max-cool-setpoint-limit"); - AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteThermostatMaxCoolSetpointLimit() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000018) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - int16_t mValue; -}; - -class ReportThermostatMaxCoolSetpointLimit : public ModelCommand -{ -public: - ReportThermostatMaxCoolSetpointLimit() : ModelCommand("subscribe") - { - AddArgument("attr-name", "max-cool-setpoint-limit"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportThermostatMaxCoolSetpointLimit() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000018) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int16_t value) - { - DataModelLogger::LogValue("Thermostat.MaxCoolSetpointLimit report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute MinSetpointDeadBand - */ -class ReadThermostatMinSetpointDeadBand : public ModelCommand -{ -public: - ReadThermostatMinSetpointDeadBand() : ModelCommand("read") - { - AddArgument("attr-name", "min-setpoint-dead-band"); - ModelCommand::AddArguments(); - } - - ~ReadThermostatMinSetpointDeadBand() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000019) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, int8_t value) - { - OnGeneralAttributeEventResponse(context, "Thermostat.MinSetpointDeadBand response", value); - } -}; - -class WriteThermostatMinSetpointDeadBand : public ModelCommand -{ -public: - WriteThermostatMinSetpointDeadBand() : ModelCommand("write") - { - AddArgument("attr-name", "min-setpoint-dead-band"); - AddArgument("attr-value", INT8_MIN, INT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteThermostatMinSetpointDeadBand() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x00000019) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - int8_t mValue; -}; - -class ReportThermostatMinSetpointDeadBand : public ModelCommand -{ -public: - ReportThermostatMinSetpointDeadBand() : ModelCommand("subscribe") - { - AddArgument("attr-name", "min-setpoint-dead-band"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportThermostatMinSetpointDeadBand() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000019) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, int8_t value) - { - DataModelLogger::LogValue("Thermostat.MinSetpointDeadBand report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute ControlSequenceOfOperation - */ -class ReadThermostatControlSequenceOfOperation : public ModelCommand -{ -public: - ReadThermostatControlSequenceOfOperation() : ModelCommand("read") - { - AddArgument("attr-name", "control-sequence-of-operation"); - ModelCommand::AddArguments(); - } - - ~ReadThermostatControlSequenceOfOperation() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x0000001B) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "Thermostat.ControlSequenceOfOperation response", value); - } -}; - -class WriteThermostatControlSequenceOfOperation : public ModelCommand -{ -public: - WriteThermostatControlSequenceOfOperation() : ModelCommand("write") - { - AddArgument("attr-name", "control-sequence-of-operation"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteThermostatControlSequenceOfOperation() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x0000001B) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint8_t mValue; -}; - -class ReportThermostatControlSequenceOfOperation : public ModelCommand -{ -public: - ReportThermostatControlSequenceOfOperation() : ModelCommand("subscribe") - { - AddArgument("attr-name", "control-sequence-of-operation"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportThermostatControlSequenceOfOperation() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x0000001B) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("Thermostat.ControlSequenceOfOperation report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute SystemMode - */ -class ReadThermostatSystemMode : public ModelCommand -{ -public: - ReadThermostatSystemMode() : ModelCommand("read") - { - AddArgument("attr-name", "system-mode"); - ModelCommand::AddArguments(); - } - - ~ReadThermostatSystemMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x0000001C) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "Thermostat.SystemMode response", value); - } -}; - -class WriteThermostatSystemMode : public ModelCommand -{ -public: - WriteThermostatSystemMode() : ModelCommand("write") - { - AddArgument("attr-name", "system-mode"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - ModelCommand::AddArguments(); - } - - ~WriteThermostatSystemMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) WriteAttribute (0x0000001C) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); - } - -private: - uint8_t mValue; -}; - -class ReportThermostatSystemMode : public ModelCommand -{ -public: - ReportThermostatSystemMode() : ModelCommand("subscribe") - { - AddArgument("attr-name", "system-mode"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportThermostatSystemMode() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x0000001C) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("Thermostat.SystemMode report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute StartOfWeek - */ -class ReadThermostatStartOfWeek : public ModelCommand -{ -public: - ReadThermostatStartOfWeek() : ModelCommand("read") - { - AddArgument("attr-name", "start-of-week"); - ModelCommand::AddArguments(); - } - - ~ReadThermostatStartOfWeek() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReadAttribute (0x00000020) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeEventResponse(context, "Thermostat.StartOfWeek response", value); - } -}; - -class ReportThermostatStartOfWeek : public ModelCommand -{ -public: - ReportThermostatStartOfWeek() : ModelCommand("subscribe") - { - AddArgument("attr-name", "start-of-week"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportThermostatStartOfWeek() {} - - CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000201) ReportAttribute (0x00000020) on endpoint %" PRIu16, endpointId); - - chip::Controller::ThermostatCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } - - static void OnValueReport(void * context, uint8_t value) - { - DataModelLogger::LogValue("Thermostat.StartOfWeek report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute NumberOfWeeklyTransitions - */ -class ReadThermostatNumberOfWeeklyTransitions : public ModelCommand -{ -public: - ReadThermostatNumberOfWeeklyTransitions() : ModelCommand("read") - { - AddArgument("attr-name", "number-of-weekly-transitions"); - ModelCommand::AddArguments(); - } +#include +#include /*----------------------------------------------------------------------------*\ | Cluster Name | ID | @@ -55461,7 +3331,32 @@ class GroupKeyManagementKeySetWrite : public ClusterCommand private: chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type mRequest; - TypedComplexArgument mComplex_GroupKeySet; + TypedComplexArgument mComplex_GroupKeySet; +}; + +class WriteGroupKeyManagementGroupKeyMap : public WriteAttribute +{ +public: + WriteGroupKeyManagementGroupKeyMap(CredentialIssuerCommands * credsIssuerConfig) : + WriteAttribute("GroupKeyMap", credsIssuerConfig), mComplex(&mValue) + { + AddArgument("attr-name", "group-key-map"); + AddArgument("attr-value", &mComplex); + WriteAttribute::AddArguments(); + } + + ~WriteGroupKeyManagementGroupKeyMap() {} + + CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override + { + return WriteAttribute::SendCommand(device, endpointId, 0x0000003F, 0x00000000, mValue); + } + +private: + chip::app::DataModel::List mValue; + TypedComplexArgument< + chip::app::DataModel::List> + mComplex; }; class WriteGroupKeyManagementGroupKeyMap : public WriteAttribute @@ -57914,6 +5809,30 @@ class ScenesAddScene : public ClusterCommand mComplex_ExtensionFieldSets; }; +/* + * Command GetSceneMembership + */ +class ScenesGetSceneMembership : public ClusterCommand +{ +public: + ScenesGetSceneMembership(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("get-scene-membership", credsIssuerConfig) + { + AddArgument("GroupId", 0, UINT16_MAX, &mRequest.groupId); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000006) on endpoint %" PRIu16, endpointId); + + return ClusterCommand::SendCommand(device, endpointId, 0x00000005, 0x00000006, mRequest); + } + +private: + chip::app::Clusters::Scenes::Commands::GetSceneMembership::Type mRequest; +}; + /* * Command RecallScene */ @@ -57940,72 +5859,366 @@ class ScenesRecallScene : public ClusterCommand }; /* - * Command RemoveScene + * Command RemoveAllScenes + */ +class ScenesRemoveAllScenes : public ClusterCommand +{ +public: + ScenesRemoveAllScenes(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("remove-all-scenes", credsIssuerConfig) + { + AddArgument("GroupId", 0, UINT16_MAX, &mRequest.groupId); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000003) on endpoint %" PRIu16, endpointId); + + return ClusterCommand::SendCommand(device, endpointId, 0x00000005, 0x00000003, mRequest); + } + +private: + chip::app::Clusters::Scenes::Commands::RemoveAllScenes::Type mRequest; +}; + +/* + * Command RemoveScene + */ +class ScenesRemoveScene : public ClusterCommand +{ +public: + ScenesRemoveScene(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("remove-scene", credsIssuerConfig) + { + AddArgument("GroupId", 0, UINT16_MAX, &mRequest.groupId); + AddArgument("SceneId", 0, UINT8_MAX, &mRequest.sceneId); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000002) on endpoint %" PRIu16, endpointId); + + return ClusterCommand::SendCommand(device, endpointId, 0x00000005, 0x00000002, mRequest); + } + +private: + chip::app::Clusters::Scenes::Commands::RemoveScene::Type mRequest; +}; + +/* + * Command StoreScene + */ +class ScenesStoreScene : public ClusterCommand +{ +public: + ScenesStoreScene(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("store-scene", credsIssuerConfig) + { + AddArgument("GroupId", 0, UINT16_MAX, &mRequest.groupId); + AddArgument("SceneId", 0, UINT8_MAX, &mRequest.sceneId); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000004) on endpoint %" PRIu16, endpointId); + + return ClusterCommand::SendCommand(device, endpointId, 0x00000005, 0x00000004, mRequest); + } + +private: + chip::app::Clusters::Scenes::Commands::StoreScene::Type mRequest; +}; + +/* + * Command ViewScene + */ +class ScenesViewScene : public ClusterCommand +{ +public: + ScenesViewScene(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("view-scene", credsIssuerConfig) + { + AddArgument("GroupId", 0, UINT16_MAX, &mRequest.groupId); + AddArgument("SceneId", 0, UINT8_MAX, &mRequest.sceneId); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000001) on endpoint %" PRIu16, endpointId); + + return ClusterCommand::SendCommand(device, endpointId, 0x00000005, 0x00000001, mRequest); + } + +private: + chip::app::Clusters::Scenes::Commands::ViewScene::Type mRequest; +}; + +/*----------------------------------------------------------------------------*\ +| Cluster SoftwareDiagnostics | 0x0034 | +|------------------------------------------------------------------------------| +| Commands: | | +| * ResetWatermarks | 0x00 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * ThreadMetrics | 0x0000 | +| * CurrentHeapFree | 0x0001 | +| * CurrentHeapUsed | 0x0002 | +| * CurrentHeapHighWatermark | 0x0003 | +| * ServerGeneratedCommandList | 0xFFF8 | +| * ClientGeneratedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * SoftwareFault | 0x0000 | +\*----------------------------------------------------------------------------*/ + +/* + * Command ResetWatermarks + */ +class SoftwareDiagnosticsResetWatermarks : public ClusterCommand +{ +public: + SoftwareDiagnosticsResetWatermarks(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("reset-watermarks", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000034) command (0x00000000) on endpoint %" PRIu16, endpointId); + + return ClusterCommand::SendCommand(device, endpointId, 0x00000034, 0x00000000, mRequest); + } + +private: + chip::app::Clusters::SoftwareDiagnostics::Commands::ResetWatermarks::Type mRequest; +}; + +/*----------------------------------------------------------------------------*\ +| Cluster Switch | 0x003B | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * NumberOfPositions | 0x0000 | +| * CurrentPosition | 0x0001 | +| * MultiPressMax | 0x0002 | +| * ServerGeneratedCommandList | 0xFFF8 | +| * ClientGeneratedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * SwitchLatched | 0x0000 | +| * InitialPress | 0x0001 | +| * LongPress | 0x0002 | +| * ShortRelease | 0x0003 | +| * LongRelease | 0x0004 | +| * MultiPressOngoing | 0x0005 | +| * MultiPressComplete | 0x0006 | +\*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*\ +| Cluster TargetNavigator | 0x0505 | +|------------------------------------------------------------------------------| +| Commands: | | +| * NavigateTargetRequest | 0x00 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * TargetNavigatorList | 0x0000 | +| * CurrentNavigatorTarget | 0x0001 | +| * ServerGeneratedCommandList | 0xFFF8 | +| * ClientGeneratedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Command NavigateTargetRequest */ -class ScenesRemoveScene : public ClusterCommand +class TargetNavigatorNavigateTargetRequest : public ClusterCommand { public: - ScenesRemoveScene(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("remove-scene", credsIssuerConfig) + TargetNavigatorNavigateTargetRequest(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("navigate-target-request", credsIssuerConfig) { - AddArgument("GroupId", 0, UINT16_MAX, &mRequest.groupId); - AddArgument("SceneId", 0, UINT8_MAX, &mRequest.sceneId); + AddArgument("Target", 0, UINT8_MAX, &mRequest.target); + AddArgument("Data", &mRequest.data); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002C) ReadAttribute (0x00000002) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000505) command (0x00000000) on endpoint %" PRIu16, endpointId); - chip::Controller::TimeFormatLocalizationCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); + return ClusterCommand::SendCommand(device, endpointId, 0x00000505, 0x00000000, mRequest); } - static void OnAttributeResponse( - void * context, - const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeEventResponse(context, "TimeFormatLocalization.SupportedCalendarTypes response", value); - } +private: + chip::app::Clusters::TargetNavigator::Commands::NavigateTargetRequest::Type mRequest; }; +/*----------------------------------------------------------------------------*\ +| Cluster TemperatureMeasurement | 0x0402 | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * MeasuredValue | 0x0000 | +| * MinMeasuredValue | 0x0001 | +| * MaxMeasuredValue | 0x0002 | +| * Tolerance | 0x0003 | +| * AttributeList | 0xFFFB | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/*----------------------------------------------------------------------------*\ +| Cluster TestCluster | 0x050F | +|------------------------------------------------------------------------------| +| Commands: | | +| * SimpleStructEchoRequest | 0x11 | +| * Test | 0x00 | +| * TestAddArguments | 0x04 | +| * TestEmitTestEventRequest | 0x14 | +| * TestEnumsRequest | 0x0E | +| * TestListInt8UArgumentRequest | 0x0A | +| * TestListInt8UReverseRequest | 0x0D | +| * TestListNestedStructListArgumentRequest | 0x0C | +| * TestListStructArgumentRequest | 0x09 | +| * TestNestedStructArgumentRequest | 0x08 | +| * TestNestedStructListArgumentRequest | 0x0B | +| * TestNotHandled | 0x01 | +| * TestNullableOptionalRequest | 0x0F | +| * TestSimpleOptionalArgumentRequest | 0x13 | +| * TestSpecific | 0x02 | +| * TestStructArgumentRequest | 0x07 | +| * TestUnknownCommand | 0x03 | +| * TimedInvokeRequest | 0x12 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * Boolean | 0x0000 | +| * Bitmap8 | 0x0001 | +| * Bitmap16 | 0x0002 | +| * Bitmap32 | 0x0003 | +| * Bitmap64 | 0x0004 | +| * Int8u | 0x0005 | +| * Int16u | 0x0006 | +| * Int24u | 0x0007 | +| * Int32u | 0x0008 | +| * Int40u | 0x0009 | +| * Int48u | 0x000A | +| * Int56u | 0x000B | +| * Int64u | 0x000C | +| * Int8s | 0x000D | +| * Int16s | 0x000E | +| * Int24s | 0x000F | +| * Int32s | 0x0010 | +| * Int40s | 0x0011 | +| * Int48s | 0x0012 | +| * Int56s | 0x0013 | +| * Int64s | 0x0014 | +| * Enum8 | 0x0015 | +| * Enum16 | 0x0016 | +| * FloatSingle | 0x0017 | +| * FloatDouble | 0x0018 | +| * OctetString | 0x0019 | +| * ListInt8u | 0x001A | +| * ListOctetString | 0x001B | +| * ListStructOctetString | 0x001C | +| * LongOctetString | 0x001D | +| * CharString | 0x001E | +| * LongCharString | 0x001F | +| * EpochUs | 0x0020 | +| * EpochS | 0x0021 | +| * VendorId | 0x0022 | +| * ListNullablesAndOptionalsStruct | 0x0023 | +| * EnumAttr | 0x0024 | +| * StructAttr | 0x0025 | +| * RangeRestrictedInt8u | 0x0026 | +| * RangeRestrictedInt8s | 0x0027 | +| * RangeRestrictedInt16u | 0x0028 | +| * RangeRestrictedInt16s | 0x0029 | +| * ListLongOctetString | 0x002A | +| * TimedWriteBoolean | 0x0030 | +| * GeneralErrorBoolean | 0x0031 | +| * ClusterErrorBoolean | 0x0032 | +| * Unsupported | 0x00FF | +| * NullableBoolean | 0x8000 | +| * NullableBitmap8 | 0x8001 | +| * NullableBitmap16 | 0x8002 | +| * NullableBitmap32 | 0x8003 | +| * NullableBitmap64 | 0x8004 | +| * NullableInt8u | 0x8005 | +| * NullableInt16u | 0x8006 | +| * NullableInt24u | 0x8007 | +| * NullableInt32u | 0x8008 | +| * NullableInt40u | 0x8009 | +| * NullableInt48u | 0x800A | +| * NullableInt56u | 0x800B | +| * NullableInt64u | 0x800C | +| * NullableInt8s | 0x800D | +| * NullableInt16s | 0x800E | +| * NullableInt24s | 0x800F | +| * NullableInt32s | 0x8010 | +| * NullableInt40s | 0x8011 | +| * NullableInt48s | 0x8012 | +| * NullableInt56s | 0x8013 | +| * NullableInt64s | 0x8014 | +| * NullableEnum8 | 0x8015 | +| * NullableEnum16 | 0x8016 | +| * NullableFloatSingle | 0x8017 | +| * NullableFloatDouble | 0x8018 | +| * NullableOctetString | 0x8019 | +| * NullableCharString | 0x801E | +| * NullableEnumAttr | 0x8024 | +| * NullableStruct | 0x8025 | +| * NullableRangeRestrictedInt8u | 0x8026 | +| * NullableRangeRestrictedInt8s | 0x8027 | +| * NullableRangeRestrictedInt16u | 0x8028 | +| * NullableRangeRestrictedInt16s | 0x8029 | +| * ServerGeneratedCommandList | 0xFFF8 | +| * ClientGeneratedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * TestEvent | 0x0001 | +| * TestFabricScopedEvent | 0x0002 | +\*----------------------------------------------------------------------------*/ + /* - * Command StoreScene + * Command SimpleStructEchoRequest */ -class ScenesStoreScene : public ClusterCommand +class TestClusterSimpleStructEchoRequest : public ClusterCommand { public: - ScenesStoreScene(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("store-scene", credsIssuerConfig) + TestClusterSimpleStructEchoRequest(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("simple-struct-echo-request", credsIssuerConfig), mComplex_Arg1(&mRequest.arg1) { - AddArgument("GroupId", 0, UINT16_MAX, &mRequest.groupId); - AddArgument("SceneId", 0, UINT8_MAX, &mRequest.sceneId); + AddArgument("Arg1", &mComplex_Arg1); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(ChipDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000005) command (0x00000004) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x00000011) on endpoint %" PRIu16, endpointId); - return ClusterCommand::SendCommand(device, endpointId, 0x00000005, 0x00000004, mRequest); + return ClusterCommand::SendCommand(device, endpointId, 0x0000050F, 0x00000011, mRequest); } private: - chip::app::Clusters::Scenes::Commands::StoreScene::Type mRequest; + chip::app::Clusters::TestCluster::Commands::SimpleStructEchoRequest::Type mRequest; + TypedComplexArgument mComplex_Arg1; }; -/*----------------------------------------------------------------------------*\ -| Cluster UserLabel | 0x0041 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * LabelList | 0x0000 | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - /* * Command Test */ @@ -62903,12 +11116,36 @@ void registerClusterLocalizationConfiguration(Commands & commands, CredentialIss const char * clusterName = "LocalizationConfiguration"; commands_list clusterCommands = { - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "active-locale", Attributes::ActiveLocale::Id, credsIssuerConfig), // + make_unique(Id, "supported-locales", Attributes::SupportedLocales::Id, credsIssuerConfig), // + make_unique(Id, "server-generated-command-list", Attributes::ServerGeneratedCommandList::Id, + credsIssuerConfig), // + make_unique(Id, "client-generated-command-list", Attributes::ClientGeneratedCommandList::Id, + credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "active-locale", Attributes::ActiveLocale::Id, credsIssuerConfig), // + make_unique(Id, "supported-locales", Attributes::SupportedLocales::Id, credsIssuerConfig), // + make_unique(Id, "server-generated-command-list", Attributes::ServerGeneratedCommandList::Id, + credsIssuerConfig), // + make_unique(Id, "client-generated-command-list", Attributes::ClientGeneratedCommandList::Id, + credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // }; commands.Register(clusterName, clusterCommands); @@ -63406,30 +11643,55 @@ void registerClusterOperationalCredentials(Commands & commands, CredentialIssuer const char * clusterName = "OperationalCredentials"; commands_list clusterCommands = { - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "nocs", Attributes::NOCs::Id, credsIssuerConfig), // + make_unique(Id, "fabrics-list", Attributes::FabricsList::Id, credsIssuerConfig), // + make_unique(Id, "supported-fabrics", Attributes::SupportedFabrics::Id, credsIssuerConfig), // + make_unique(Id, "commissioned-fabrics", Attributes::CommissionedFabrics::Id, credsIssuerConfig), // + make_unique(Id, "trusted-root-certificates", Attributes::TrustedRootCertificates::Id, credsIssuerConfig), // + make_unique(Id, "current-fabric-index", Attributes::CurrentFabricIndex::Id, credsIssuerConfig), // + make_unique(Id, "server-generated-command-list", Attributes::ServerGeneratedCommandList::Id, + credsIssuerConfig), // + make_unique(Id, "client-generated-command-list", Attributes::ClientGeneratedCommandList::Id, + credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "nocs", Attributes::NOCs::Id, credsIssuerConfig), // + make_unique(Id, "fabrics-list", Attributes::FabricsList::Id, credsIssuerConfig), // + make_unique(Id, "supported-fabrics", Attributes::SupportedFabrics::Id, credsIssuerConfig), // + make_unique(Id, "commissioned-fabrics", Attributes::CommissionedFabrics::Id, credsIssuerConfig), // + make_unique(Id, "trusted-root-certificates", Attributes::TrustedRootCertificates::Id, + credsIssuerConfig), // + make_unique(Id, "current-fabric-index", Attributes::CurrentFabricIndex::Id, credsIssuerConfig), // + make_unique(Id, "server-generated-command-list", Attributes::ServerGeneratedCommandList::Id, + credsIssuerConfig), // + make_unique(Id, "client-generated-command-list", Attributes::ClientGeneratedCommandList::Id, + credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // }; commands.Register(clusterName, clusterCommands); @@ -64645,12 +12907,40 @@ void registerClusterTimeFormatLocalization(Commands & commands, CredentialIssuer const char * clusterName = "TimeFormatLocalization"; commands_list clusterCommands = { - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "hour-format", Attributes::HourFormat::Id, credsIssuerConfig), // + make_unique(Id, "active-calendar-type", Attributes::ActiveCalendarType::Id, credsIssuerConfig), // + make_unique(Id, "supported-calendar-types", Attributes::SupportedCalendarTypes::Id, credsIssuerConfig), // + make_unique(Id, "server-generated-command-list", Attributes::ServerGeneratedCommandList::Id, + credsIssuerConfig), // + make_unique(Id, "client-generated-command-list", Attributes::ClientGeneratedCommandList::Id, + credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "hour-format", Attributes::HourFormat::Id, credsIssuerConfig), // + make_unique(Id, "active-calendar-type", Attributes::ActiveCalendarType::Id, credsIssuerConfig), // + make_unique(Id, "supported-calendar-types", Attributes::SupportedCalendarTypes::Id, + credsIssuerConfig), // + make_unique(Id, "server-generated-command-list", Attributes::ServerGeneratedCommandList::Id, + credsIssuerConfig), // + make_unique(Id, "client-generated-command-list", Attributes::ClientGeneratedCommandList::Id, + credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // }; commands.Register(clusterName, clusterCommands); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index f90bb5a516591b..56555680f45b41 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -578,15 +578,14 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::OperationalCredentials ComplexArgumentParser::Finalize(request.label); } CHIP_ERROR ComplexArgumentParser::Setup(const char * label, - chip::app::Clusters::GroupKeyManagement::Structs::GroupInfo::Type & request, + chip::app::Clusters::GroupKeyManagement::Structs::GroupInfoMapStruct::Type & request, Json::Value & value) { VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("GroupInfo.fabricIndex", value.isMember("fabricIndex"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("GroupInfo.groupId", value.isMember("groupId"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("GroupInfo.endpoints", value.isMember("endpoints"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("GroupInfo.groupName", value.isMember("groupName"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("GroupInfoMapStruct.fabricIndex", value.isMember("fabricIndex"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("GroupInfoMapStruct.groupId", value.isMember("groupId"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("GroupInfoMapStruct.endpoints", value.isMember("endpoints"))); char labelWithMember[kMaxLabelLength]; snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "fabricIndex"); @@ -598,13 +597,16 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "endpoints"); ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.endpoints, value["endpoints"])); - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "groupName"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.groupName, value["groupName"])); + if (value.isMember("groupName")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "groupName"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.groupName, value["groupName"])); + } return CHIP_NO_ERROR; } -void ComplexArgumentParser::Finalize(chip::app::Clusters::GroupKeyManagement::Structs::GroupInfo::Type & request) +void ComplexArgumentParser::Finalize(chip::app::Clusters::GroupKeyManagement::Structs::GroupInfoMapStruct::Type & request) { ComplexArgumentParser::Finalize(request.fabricIndex); ComplexArgumentParser::Finalize(request.groupId); @@ -612,14 +614,15 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::GroupKeyManagement::St ComplexArgumentParser::Finalize(request.groupName); } CHIP_ERROR ComplexArgumentParser::Setup(const char * label, - chip::app::Clusters::GroupKeyManagement::Structs::GroupKey::Type & request, + chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::Type & request, Json::Value & value) { VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("GroupKey.fabricIndex", value.isMember("fabricIndex"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("GroupKey.groupId", value.isMember("groupId"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("GroupKey.groupKeySetID", value.isMember("groupKeySetID"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("GroupKeyMapStruct.fabricIndex", value.isMember("fabricIndex"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("GroupKeyMapStruct.groupId", value.isMember("groupId"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("GroupKeyMapStruct.groupKeySetID", value.isMember("groupKeySetID"))); char labelWithMember[kMaxLabelLength]; snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "fabricIndex"); @@ -634,36 +637,39 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, return CHIP_NO_ERROR; } -void ComplexArgumentParser::Finalize(chip::app::Clusters::GroupKeyManagement::Structs::GroupKey::Type & request) +void ComplexArgumentParser::Finalize(chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::Type & request) { ComplexArgumentParser::Finalize(request.fabricIndex); ComplexArgumentParser::Finalize(request.groupId); ComplexArgumentParser::Finalize(request.groupKeySetID); } CHIP_ERROR ComplexArgumentParser::Setup(const char * label, - chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySet::Type & request, + chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::Type & request, Json::Value & value) { VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("GroupKeySet.groupKeySetID", value.isMember("groupKeySetID"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("GroupKeySet.securityPolicy", value.isMember("securityPolicy"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("GroupKeySet.epochKey0", value.isMember("epochKey0"))); ReturnErrorOnFailure( - ComplexArgumentParser::EnsureMemberExist("GroupKeySet.epochStartTime0", value.isMember("epochStartTime0"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("GroupKeySet.epochKey1", value.isMember("epochKey1"))); + ComplexArgumentParser::EnsureMemberExist("GroupKeySetStruct.groupKeySetID", value.isMember("groupKeySetID"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("GroupKeySetStruct.groupKeySecurityPolicy", + value.isMember("groupKeySecurityPolicy"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("GroupKeySetStruct.epochKey0", value.isMember("epochKey0"))); ReturnErrorOnFailure( - ComplexArgumentParser::EnsureMemberExist("GroupKeySet.epochStartTime1", value.isMember("epochStartTime1"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("GroupKeySet.epochKey2", value.isMember("epochKey2"))); + ComplexArgumentParser::EnsureMemberExist("GroupKeySetStruct.epochStartTime0", value.isMember("epochStartTime0"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("GroupKeySetStruct.epochKey1", value.isMember("epochKey1"))); ReturnErrorOnFailure( - ComplexArgumentParser::EnsureMemberExist("GroupKeySet.epochStartTime2", value.isMember("epochStartTime2"))); + ComplexArgumentParser::EnsureMemberExist("GroupKeySetStruct.epochStartTime1", value.isMember("epochStartTime1"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("GroupKeySetStruct.epochKey2", value.isMember("epochKey2"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("GroupKeySetStruct.epochStartTime2", value.isMember("epochStartTime2"))); char labelWithMember[kMaxLabelLength]; snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "groupKeySetID"); ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.groupKeySetID, value["groupKeySetID"])); - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "securityPolicy"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.securityPolicy, value["securityPolicy"])); + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "groupKeySecurityPolicy"); + ReturnErrorOnFailure( + ComplexArgumentParser::Setup(labelWithMember, request.groupKeySecurityPolicy, value["groupKeySecurityPolicy"])); snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "epochKey0"); ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.epochKey0, value["epochKey0"])); @@ -686,10 +692,10 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, return CHIP_NO_ERROR; } -void ComplexArgumentParser::Finalize(chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySet::Type & request) +void ComplexArgumentParser::Finalize(chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::Type & request) { ComplexArgumentParser::Finalize(request.groupKeySetID); - ComplexArgumentParser::Finalize(request.securityPolicy); + ComplexArgumentParser::Finalize(request.groupKeySecurityPolicy); ComplexArgumentParser::Finalize(request.epochKey0); ComplexArgumentParser::Finalize(request.epochStartTime0); ComplexArgumentParser::Finalize(request.epochKey1); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index 7528e3da0cfc1a..6ba52de3b247d4 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -96,18 +96,18 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::OperationalCred Json::Value & value); static void Finalize(chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::Type & request); -static CHIP_ERROR Setup(const char * label, chip::app::Clusters::GroupKeyManagement::Structs::GroupInfo::Type & request, +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::GroupKeyManagement::Structs::GroupInfoMapStruct::Type & request, Json::Value & value); -static void Finalize(chip::app::Clusters::GroupKeyManagement::Structs::GroupInfo::Type & request); -static CHIP_ERROR Setup(const char * label, chip::app::Clusters::GroupKeyManagement::Structs::GroupKey::Type & request, +static void Finalize(chip::app::Clusters::GroupKeyManagement::Structs::GroupInfoMapStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::Type & request, Json::Value & value); -static void Finalize(chip::app::Clusters::GroupKeyManagement::Structs::GroupKey::Type & request); -static CHIP_ERROR Setup(const char * label, chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySet::Type & request, +static void Finalize(chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::Type & request, Json::Value & value); -static void Finalize(chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySet::Type & request); +static void Finalize(chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::Type & request); static CHIP_ERROR Setup(const char * label, chip::app::Clusters::IasAce::Structs::IasAceZoneStatusResult::Type & request, Json::Value & value); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index e1ea22959ca0ad..9fc427490bd176 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -627,8 +627,9 @@ DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::GroupKeyManagement::Structs::GroupInfo::DecodableType & value) +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::GroupKeyManagement::Structs::GroupInfoMapStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { @@ -667,8 +668,9 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::GroupKeyManagement::Structs::GroupKey::DecodableType & value) +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { @@ -699,8 +701,9 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySet::DecodableType & value) +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { @@ -712,10 +715,10 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, } } { - CHIP_ERROR err = LogValue("SecurityPolicy", indent + 1, value.securityPolicy); + CHIP_ERROR err = LogValue("GroupKeySecurityPolicy", indent + 1, value.groupKeySecurityPolicy); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SecurityPolicy'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'GroupKeySecurityPolicy'"); return err; } } @@ -5419,24 +5422,26 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP switch (path.mAttributeId) { case GroupKeyManagement::Attributes::GroupKeyMap::Id: { - chip::app::DataModel::DecodableList value; + chip::app::DataModel::DecodableList + value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("groupKeyMap", 1, value); + return DataModelLogger::LogValue("GroupKeyMap", 1, value); } case GroupKeyManagement::Attributes::GroupTable::Id: { - chip::app::DataModel::DecodableList value; + chip::app::DataModel::DecodableList + value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("groupTable", 1, value); + return DataModelLogger::LogValue("GroupTable", 1, value); } case GroupKeyManagement::Attributes::MaxGroupsPerFabric::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("maxGroupsPerFabric", 1, value); + return DataModelLogger::LogValue("MaxGroupsPerFabric", 1, value); } case GroupKeyManagement::Attributes::MaxGroupKeysPerFabric::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("maxGroupKeysPerFabric", 1, value); + return DataModelLogger::LogValue("MaxGroupKeysPerFabric", 1, value); } case GroupKeyManagement::Attributes::ServerGeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index 7ad11c3e3c0298..c5f51926128e17 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -58,11 +58,11 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::GroupKeyManagement::Structs::GroupInfo::DecodableType & value); + const chip::app::Clusters::GroupKeyManagement::Structs::GroupInfoMapStruct::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::GroupKeyManagement::Structs::GroupKey::DecodableType & value); + const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySet::DecodableType & value); + const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::IasAce::Structs::IasAceZoneStatusResult::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 9215078abca9c1..87a0c7d59920d3 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -85503,6 +85503,62 @@ class TestGroupKeyManagementCluster : public TestCommand ChipLogProgress(chipTool, " ***** Test Step 2 : Read maxGroupKeysPerFabric\n"); err = TestReadMaxGroupKeysPerFabric_2(); break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Add Group 1\n"); + err = TestAddGroup1_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Add Group 2\n"); + err = TestAddGroup2_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : KeySet Write 1\n"); + err = TestKeySetWrite1_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : KeySet Write 2\n"); + err = TestKeySetWrite2_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : KeySet Read\n"); + err = TestKeySetRead_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Write Group Keys\n"); + err = TestWriteGroupKeys_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Read Group Keys\n"); + err = TestReadGroupKeys_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read GroupTable\n"); + err = TestReadGroupTable_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : KeySet Remove 1\n"); + err = TestKeySetRemove1_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : KeySet Read (removed)\n"); + err = TestKeySetReadRemoved_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : KeySet Read (not removed)\n"); + err = TestKeySetReadNotRemoved_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Remove All\n"); + err = TestRemoveAll_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : KeySet Remove 2\n"); + err = TestKeySetRemove2_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : KeySet Read (also removed)\n"); + err = TestKeySetReadAlsoRemoved_16(); + break; } if (CHIP_NO_ERROR != err) @@ -85514,7 +85570,7 @@ class TestGroupKeyManagementCluster : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + const uint16_t mTestCount = 17; chip::Optional mCluster; chip::Optional mEndpoint; @@ -85539,6 +85595,42 @@ class TestGroupKeyManagementCluster : public TestCommand (static_cast(context))->OnSuccessResponse_2(maxGroupKeysPerFabric); } + static void OnFailureCallback_8(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_8(error); + } + + static void OnSuccessCallback_8(void * context) + { + (static_cast(context))->OnSuccessResponse_8(); + } + + static void OnFailureCallback_9(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_9(error); + } + + static void + OnSuccessCallback_9(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::DecodableType> & groupKeyMap) + { + (static_cast(context))->OnSuccessResponse_9(groupKeyMap); + } + + static void OnFailureCallback_10(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_10(error); + } + + static void + OnSuccessCallback_10(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::GroupKeyManagement::Structs::GroupInfoMapStruct::DecodableType> & groupTable) + { + (static_cast(context))->OnSuccessResponse_10(groupTable); + } + // // Tests methods // @@ -85597,6 +85689,528 @@ class TestGroupKeyManagementCluster : public TestCommand NextTest(); } + + CHIP_ERROR TestAddGroup1_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + using RequestType = chip::app::Clusters::Groups::Commands::AddGroup::Type; + + RequestType request; + request.groupId = 17U; + request.groupName = chip::Span("Group #1garbage: not in length on purpose", 8); + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_3(data.status, data.groupId); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_3(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_3(uint8_t status, uint16_t groupId) + { + VerifyOrReturn(CheckValue("status", status, 0)); + + VerifyOrReturn(CheckValue("groupId", groupId, 17U)); + + NextTest(); + } + + CHIP_ERROR TestAddGroup2_4() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + using RequestType = chip::app::Clusters::Groups::Commands::AddGroup::Type; + + RequestType request; + request.groupId = 18U; + request.groupName = chip::Span("Group #2garbage: not in length on purpose", 8); + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_4(data.status, data.groupId); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_4(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_4(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_4(uint8_t status, uint16_t groupId) + { + VerifyOrReturn(CheckValue("status", status, 0)); + + VerifyOrReturn(CheckValue("groupId", groupId, 18U)); + + NextTest(); + } + + CHIP_ERROR TestKeySetWrite1_5() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + using RequestType = chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type; + + RequestType request; + + request.groupKeySet.groupKeySetID = 257U; + request.groupKeySet.groupKeySecurityPolicy = + static_cast(0); + request.groupKeySet.epochKey0.SetNonNull(); + request.groupKeySet.epochKey0.Value() = + chip::ByteSpan(chip::Uint8::from_const_char( + "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xafgarbage: not in length on purpose"), + 16); + request.groupKeySet.epochStartTime0.SetNonNull(); + request.groupKeySet.epochStartTime0.Value() = 1110000ULL; + request.groupKeySet.epochKey1.SetNonNull(); + request.groupKeySet.epochKey1.Value() = + chip::ByteSpan(chip::Uint8::from_const_char( + "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbfgarbage: not in length on purpose"), + 16); + request.groupKeySet.epochStartTime1.SetNonNull(); + request.groupKeySet.epochStartTime1.Value() = 1110001ULL; + request.groupKeySet.epochKey2.SetNonNull(); + request.groupKeySet.epochKey2.Value() = + chip::ByteSpan(chip::Uint8::from_const_char( + "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcfgarbage: not in length on purpose"), + 16); + request.groupKeySet.epochStartTime2.SetNonNull(); + request.groupKeySet.epochStartTime2.Value() = 1110002ULL; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_5(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_5(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_5(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_5() { NextTest(); } + + CHIP_ERROR TestKeySetWrite2_6() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + using RequestType = chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type; + + RequestType request; + + request.groupKeySet.groupKeySetID = 258U; + request.groupKeySet.groupKeySecurityPolicy = + static_cast(1); + request.groupKeySet.epochKey0.SetNonNull(); + request.groupKeySet.epochKey0.Value() = + chip::ByteSpan(chip::Uint8::from_const_char( + "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdfgarbage: not in length on purpose"), + 16); + request.groupKeySet.epochStartTime0.SetNonNull(); + request.groupKeySet.epochStartTime0.Value() = 2110000ULL; + request.groupKeySet.epochKey1.SetNonNull(); + request.groupKeySet.epochKey1.Value() = + chip::ByteSpan(chip::Uint8::from_const_char( + "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xefgarbage: not in length on purpose"), + 16); + request.groupKeySet.epochStartTime1.SetNonNull(); + request.groupKeySet.epochStartTime1.Value() = 2110001ULL; + request.groupKeySet.epochKey2.SetNonNull(); + request.groupKeySet.epochKey2.Value() = + chip::ByteSpan(chip::Uint8::from_const_char( + "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xffgarbage: not in length on purpose"), + 16); + request.groupKeySet.epochStartTime2.SetNonNull(); + request.groupKeySet.epochStartTime2.Value() = 2110002ULL; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_6(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_6(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_6(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_6() { NextTest(); } + + CHIP_ERROR TestKeySetRead_7() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + using RequestType = chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type; + + RequestType request; + request.groupKeySetID = 257U; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_7(data.groupKeySet); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_7(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_7(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_7(const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::DecodableType & groupKeySet) + { + VerifyOrReturn(CheckValue("groupKeySet.groupKeySetID", groupKeySet.groupKeySetID, 257U)); + VerifyOrReturn(CheckValue("groupKeySet.groupKeySecurityPolicy", groupKeySet.groupKeySecurityPolicy, 0)); + VerifyOrReturn(CheckValueNull("groupKeySet.epochKey0", groupKeySet.epochKey0)); + VerifyOrReturn(CheckValueNonNull("groupKeySet.epochStartTime0", groupKeySet.epochStartTime0)); + VerifyOrReturn(CheckValue("groupKeySet.epochStartTime0.Value()", groupKeySet.epochStartTime0.Value(), 1110000ULL)); + VerifyOrReturn(CheckValueNull("groupKeySet.epochKey1", groupKeySet.epochKey1)); + VerifyOrReturn(CheckValueNonNull("groupKeySet.epochStartTime1", groupKeySet.epochStartTime1)); + VerifyOrReturn(CheckValue("groupKeySet.epochStartTime1.Value()", groupKeySet.epochStartTime1.Value(), 1110001ULL)); + VerifyOrReturn(CheckValueNull("groupKeySet.epochKey2", groupKeySet.epochKey2)); + VerifyOrReturn(CheckValueNonNull("groupKeySet.epochStartTime2", groupKeySet.epochStartTime2)); + VerifyOrReturn(CheckValue("groupKeySet.epochStartTime2.Value()", groupKeySet.epochStartTime2.Value(), 1110002ULL)); + + NextTest(); + } + + CHIP_ERROR TestWriteGroupKeys_8() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::GroupKeyManagementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::List + groupKeyMapArgument; + + chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::Type groupKeyMapList_0[2]; + + groupKeyMapList_0[0].fabricIndex = 1; + groupKeyMapList_0[0].groupId = 17U; + groupKeyMapList_0[0].groupKeySetID = 257U; + + groupKeyMapList_0[1].fabricIndex = 1; + groupKeyMapList_0[1].groupId = 18U; + groupKeyMapList_0[1].groupKeySetID = 258U; + + groupKeyMapArgument = groupKeyMapList_0; + + ReturnErrorOnFailure(cluster.WriteAttribute( + groupKeyMapArgument, this, OnSuccessCallback_8, OnFailureCallback_8)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_8(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_8() { NextTest(); } + + CHIP_ERROR TestReadGroupKeys_9() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::GroupKeyManagementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_9, OnFailureCallback_9)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_9(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_9(const chip::app::DataModel::DecodableList< + chip::app::Clusters::GroupKeyManagement::Structs::GroupKeyMapStruct::DecodableType> & groupKeyMap) + { + { + auto iter_0 = groupKeyMap.begin(); + VerifyOrReturn(CheckNextListItemDecodes("groupKeyMap", iter_0, 0)); + VerifyOrReturn(CheckValue("groupKeyMap[0].fabricIndex", iter_0.GetValue().fabricIndex, 1)); + VerifyOrReturn(CheckValue("groupKeyMap[0].groupId", iter_0.GetValue().groupId, 17U)); + VerifyOrReturn(CheckValue("groupKeyMap[0].groupKeySetID", iter_0.GetValue().groupKeySetID, 257U)); + VerifyOrReturn(CheckNextListItemDecodes("groupKeyMap", iter_0, 1)); + VerifyOrReturn(CheckValue("groupKeyMap[1].fabricIndex", iter_0.GetValue().fabricIndex, 1)); + VerifyOrReturn(CheckValue("groupKeyMap[1].groupId", iter_0.GetValue().groupId, 18U)); + VerifyOrReturn(CheckValue("groupKeyMap[1].groupKeySetID", iter_0.GetValue().groupKeySetID, 258U)); + VerifyOrReturn(CheckNoMoreListItems("groupKeyMap", iter_0, 2)); + } + + NextTest(); + } + + CHIP_ERROR TestReadGroupTable_10() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::GroupKeyManagementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_10, OnFailureCallback_10)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_10(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_10(const chip::app::DataModel::DecodableList< + chip::app::Clusters::GroupKeyManagement::Structs::GroupInfoMapStruct::DecodableType> & groupTable) + { + { + auto iter_0 = groupTable.begin(); + VerifyOrReturn(CheckNextListItemDecodes("groupTable", iter_0, 0)); + VerifyOrReturn(CheckValue("groupTable[0].fabricIndex", iter_0.GetValue().fabricIndex, 1)); + VerifyOrReturn(CheckValue("groupTable[0].groupId", iter_0.GetValue().groupId, 17U)); + VerifyOrReturn(CheckValuePresent("groupTable[0].groupName", iter_0.GetValue().groupName)); + VerifyOrReturn(CheckValueAsString("groupTable[0].groupName.Value()", iter_0.GetValue().groupName.Value(), + chip::CharSpan("Group #1", 8))); + VerifyOrReturn(CheckNextListItemDecodes("groupTable", iter_0, 1)); + VerifyOrReturn(CheckValue("groupTable[1].fabricIndex", iter_0.GetValue().fabricIndex, 1)); + VerifyOrReturn(CheckValue("groupTable[1].groupId", iter_0.GetValue().groupId, 18U)); + VerifyOrReturn(CheckValuePresent("groupTable[1].groupName", iter_0.GetValue().groupName)); + VerifyOrReturn(CheckValueAsString("groupTable[1].groupName.Value()", iter_0.GetValue().groupName.Value(), + chip::CharSpan("Group #2", 8))); + VerifyOrReturn(CheckNoMoreListItems("groupTable", iter_0, 2)); + } + + NextTest(); + } + + CHIP_ERROR TestKeySetRemove1_11() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + using RequestType = chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Type; + + RequestType request; + request.groupKeySetID = 257U; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_11(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_11(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_11(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_11() { NextTest(); } + + CHIP_ERROR TestKeySetReadRemoved_12() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + using RequestType = chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type; + + RequestType request; + request.groupKeySetID = 257U; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_12(data.groupKeySet); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_12(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_12(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_NOT_FOUND)); + NextTest(); + } + + void + OnSuccessResponse_12(const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::DecodableType & groupKeySet) + { + ThrowSuccessResponse(); + } + + CHIP_ERROR TestKeySetReadNotRemoved_13() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + using RequestType = chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type; + + RequestType request; + request.groupKeySetID = 258U; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_13(data.groupKeySet); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_13(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_13(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void + OnSuccessResponse_13(const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::DecodableType & groupKeySet) + { + VerifyOrReturn(CheckValue("groupKeySet.groupKeySetID", groupKeySet.groupKeySetID, 258U)); + VerifyOrReturn(CheckValue("groupKeySet.groupKeySecurityPolicy", groupKeySet.groupKeySecurityPolicy, 1)); + VerifyOrReturn(CheckValueNull("groupKeySet.epochKey0", groupKeySet.epochKey0)); + VerifyOrReturn(CheckValueNonNull("groupKeySet.epochStartTime0", groupKeySet.epochStartTime0)); + VerifyOrReturn(CheckValue("groupKeySet.epochStartTime0.Value()", groupKeySet.epochStartTime0.Value(), 2110000ULL)); + VerifyOrReturn(CheckValueNull("groupKeySet.epochKey1", groupKeySet.epochKey1)); + VerifyOrReturn(CheckValueNonNull("groupKeySet.epochStartTime1", groupKeySet.epochStartTime1)); + VerifyOrReturn(CheckValue("groupKeySet.epochStartTime1.Value()", groupKeySet.epochStartTime1.Value(), 2110001ULL)); + VerifyOrReturn(CheckValueNull("groupKeySet.epochKey2", groupKeySet.epochKey2)); + VerifyOrReturn(CheckValueNonNull("groupKeySet.epochStartTime2", groupKeySet.epochStartTime2)); + VerifyOrReturn(CheckValue("groupKeySet.epochStartTime2.Value()", groupKeySet.epochStartTime2.Value(), 2110002ULL)); + + NextTest(); + } + + CHIP_ERROR TestRemoveAll_14() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 1; + using RequestType = chip::app::Clusters::Groups::Commands::RemoveAllGroups::Type; + + RequestType request; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_14(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_14(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_14(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_14() { NextTest(); } + + CHIP_ERROR TestKeySetRemove2_15() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + using RequestType = chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Type; + + RequestType request; + request.groupKeySetID = 258U; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_15(); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_15(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_15(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_15() { NextTest(); } + + CHIP_ERROR TestKeySetReadAlsoRemoved_16() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + using RequestType = chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type; + + RequestType request; + request.groupKeySetID = 258U; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_16(data.groupKeySet); + }; + + auto failure = [](void * context, CHIP_ERROR error) { + (static_cast(context))->OnFailureResponse_16(error); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_16(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_NOT_FOUND)); + NextTest(); + } + + void + OnSuccessResponse_16(const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::DecodableType & groupKeySet) + { + ThrowSuccessResponse(); + } }; void registerCommandsTests(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h index c1cb780d648b36..4aa7eb72926196 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h @@ -30,96 +30,6 @@ #include #include -// Note: The IMDefaultResponseCallback is a bridge to the old CallbackMgr before IM is landed, so it still accepts EmberAfStatus -// instead of IM status code. -// #6308 should handle IM error code on the application side, either modify this function or remove this. - -// Cluster Specific Response Callbacks -typedef void (*AccountLoginClusterGetSetupPINResponseCallback)(void * context, chip::CharSpan setupPIN); -typedef void (*ApplicationLauncherClusterLauncherResponseCallback)(void * context, uint8_t status, chip::CharSpan data); -typedef void (*ChannelClusterChangeChannelResponseCallback)(void * context, ChannelInfo channelMatch, uint8_t errorType); -typedef void (*ContentLauncherClusterLaunchResponseCallback)(void * context, uint8_t status, chip::CharSpan data); -typedef void (*DiagnosticLogsClusterRetrieveLogsResponseCallback)(void * context, uint8_t status, chip::ByteSpan content, - uint32_t timeStamp, uint32_t timeSinceBoot); -typedef void (*DoorLockClusterGetCredentialStatusResponseCallback)(void * context, bool credentialExists, uint16_t userIndex, - uint16_t nextCredentialIndex); -typedef void (*DoorLockClusterGetUserResponseCallback)(void * context, uint16_t userIndex, chip::CharSpan userName, - uint32_t userUniqueId, uint8_t userStatus, uint8_t userType, - uint8_t credentialRule, - /* TYPE WARNING: array array defaults to */ uint8_t * credentials, - chip::FabricIndex creatorFabricIndex, - chip::FabricIndex lastModifiedFabricIndex, uint16_t nextUserIndex); -typedef void (*DoorLockClusterGetWeekDayScheduleResponseCallback)(void * context, uint8_t weekDayIndex, uint16_t userIndex, - uint8_t status, uint8_t daysMask, uint8_t startHour, - uint8_t startMinute, uint8_t endHour, uint8_t endMinute); -typedef void (*DoorLockClusterGetYearDayScheduleResponseCallback)(void * context, uint8_t yearDayIndex, uint16_t userIndex, - uint8_t status, uint32_t localStartTime, uint32_t localEndTime); -typedef void (*DoorLockClusterSetCredentialResponseCallback)(void * context, uint8_t status, uint16_t userIndex, - uint16_t nextCredentialIndex); -typedef void (*GeneralCommissioningClusterArmFailSafeResponseCallback)(void * context, uint8_t errorCode, chip::CharSpan debugText); -typedef void (*GeneralCommissioningClusterCommissioningCompleteResponseCallback)(void * context, uint8_t errorCode, - chip::CharSpan debugText); -typedef void (*GeneralCommissioningClusterSetRegulatoryConfigResponseCallback)(void * context, uint8_t errorCode, - chip::CharSpan debugText); -typedef void (*GroupKeyManagementClusterKeySetReadAllIndicesResponseCallback)( - void * context, /* TYPE WARNING: array array defaults to */ uint8_t * GroupKeySetIDs); -typedef void (*GroupKeyManagementClusterKeySetReadResponseCallback)(void * context, GroupKeySetStruct GroupKeySet); -typedef void (*GroupsClusterAddGroupResponseCallback)(void * context, uint8_t status, uint16_t groupId); -typedef void (*GroupsClusterGetGroupMembershipResponseCallback)(void * context, uint8_t capacity, - /* TYPE WARNING: array array defaults to */ uint8_t * groupList); -typedef void (*GroupsClusterRemoveGroupResponseCallback)(void * context, uint8_t status, uint16_t groupId); -typedef void (*GroupsClusterViewGroupResponseCallback)(void * context, uint8_t status, uint16_t groupId, chip::CharSpan groupName); -typedef void (*IdentifyClusterIdentifyQueryResponseCallback)(void * context, uint16_t timeout); -typedef void (*KeypadInputClusterSendKeyResponseCallback)(void * context, uint8_t status); -typedef void (*MediaPlaybackClusterPlaybackResponseCallback)(void * context, uint8_t status); -typedef void (*NetworkCommissioningClusterConnectNetworkResponseCallback)(void * context, uint8_t NetworkingStatus, - chip::CharSpan DebugText, int32_t ErrorValue); -typedef void (*NetworkCommissioningClusterNetworkConfigResponseCallback)(void * context, uint8_t NetworkingStatus, - chip::CharSpan DebugText); -typedef void (*NetworkCommissioningClusterScanNetworksResponseCallback)( - void * context, uint8_t NetworkingStatus, chip::CharSpan DebugText, - /* TYPE WARNING: array array defaults to */ uint8_t * WiFiScanResults, - /* TYPE WARNING: array array defaults to */ uint8_t * ThreadScanResults); -typedef void (*OtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback)(void * context, uint8_t action, - uint32_t delayedActionTime); -typedef void (*OtaSoftwareUpdateProviderClusterQueryImageResponseCallback)( - void * context, uint8_t status, uint32_t delayedActionTime, chip::CharSpan imageURI, uint32_t softwareVersion, - chip::CharSpan softwareVersionString, chip::ByteSpan updateToken, bool userConsentNeeded, chip::ByteSpan metadataForRequestor); -typedef void (*OperationalCredentialsClusterAttestationResponseCallback)(void * context, chip::ByteSpan AttestationElements, - chip::ByteSpan Signature); -typedef void (*OperationalCredentialsClusterCertificateChainResponseCallback)(void * context, chip::ByteSpan Certificate); -typedef void (*OperationalCredentialsClusterNOCResponseCallback)(void * context, uint8_t StatusCode, uint8_t FabricIndex, - chip::CharSpan DebugText); -typedef void (*OperationalCredentialsClusterOpCSRResponseCallback)(void * context, chip::ByteSpan NOCSRElements, - chip::ByteSpan AttestationSignature); -typedef void (*ScenesClusterAddSceneResponseCallback)(void * context, uint8_t status, uint16_t groupId, uint8_t sceneId); -typedef void (*ScenesClusterGetSceneMembershipResponseCallback)(void * context, uint8_t status, uint8_t capacity, uint16_t groupId, - uint8_t sceneCount, - /* TYPE WARNING: array array defaults to */ uint8_t * sceneList); -typedef void (*ScenesClusterRemoveAllScenesResponseCallback)(void * context, uint8_t status, uint16_t groupId); -typedef void (*ScenesClusterRemoveSceneResponseCallback)(void * context, uint8_t status, uint16_t groupId, uint8_t sceneId); -typedef void (*ScenesClusterStoreSceneResponseCallback)(void * context, uint8_t status, uint16_t groupId, uint8_t sceneId); -typedef void (*ScenesClusterViewSceneResponseCallback)(void * context, uint8_t status, uint16_t groupId, uint8_t sceneId, - uint16_t transitionTime, chip::CharSpan sceneName, - /* TYPE WARNING: array array defaults to */ uint8_t * extensionFieldSets); -typedef void (*TargetNavigatorClusterNavigateTargetResponseCallback)(void * context, uint8_t status, chip::CharSpan data); -typedef void (*TestClusterClusterBooleanResponseCallback)(void * context, bool value); -typedef void (*TestClusterClusterSimpleStructResponseCallback)(void * context, SimpleStruct arg1); -typedef void (*TestClusterClusterTestAddArgumentsResponseCallback)(void * context, uint8_t returnValue); -typedef void (*TestClusterClusterTestEmitTestEventResponseCallback)(void * context, uint64_t value); -typedef void (*TestClusterClusterTestEnumsResponseCallback)(void * context, chip::VendorId arg1, uint8_t arg2); -typedef void (*TestClusterClusterTestListInt8UReverseResponseCallback)(void * context, - /* TYPE WARNING: array array defaults to */ uint8_t * arg1); -typedef void (*TestClusterClusterTestNullableOptionalResponseCallback)(void * context, bool wasPresent, bool wasNull, uint8_t value, - uint8_t originalValue); -typedef void (*TestClusterClusterTestSpecificResponseCallback)(void * context, uint8_t returnValue); -typedef void (*ThermostatClusterGetRelayStatusLogResponseCallback)(void * context, uint16_t timeOfDay, uint16_t relayStatus, - int16_t localTemperature, uint8_t humidityInPercentage, - int16_t setpoint, uint16_t unreadEntries); -typedef void (*ThermostatClusterGetWeeklyScheduleResponseCallback)(void * context, uint8_t numberOfTransitionsForSequence, - uint8_t dayOfWeekForSequence, uint8_t modeForSequence, - /* TYPE WARNING: array array defaults to */ uint8_t * payload); - // List specific responses void AccessControlClusterAclListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, chip::Callback::Cancelable * onFailureCallback); @@ -596,6 +506,16 @@ typedef void (*GroupKeyManagementGroupTableListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); +void GroupKeyManagementClusterServerGeneratedCommandListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GroupKeyManagementServerGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void GroupKeyManagementClusterClientGeneratedCommandListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GroupKeyManagementClientGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); void GroupKeyManagementClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, chip::Callback::Cancelable * onFailureCallback); diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h index 8c7df7a6d878cc..ae1737b2edca92 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h @@ -210,18 +210,6 @@ class DLL_EXPORT GroupKeyManagementCluster : public ClusterBase public: GroupKeyManagementCluster() : ClusterBase(app::Clusters::GroupKeyManagement::Id) {} ~GroupKeyManagementCluster() {} - - // Cluster Commands - CHIP_ERROR KeySetRead(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t groupKeySetID); - CHIP_ERROR KeySetReadAllIndices(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t groupKeySetIDs); - CHIP_ERROR KeySetRemove(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t groupKeySetID); - CHIP_ERROR KeySetWrite(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t groupKeySetID, uint8_t groupKeySecurityPolicy, chip::ByteSpan epochKey0, - uint64_t epochStartTime0, chip::ByteSpan epochKey1, uint64_t epochStartTime1, chip::ByteSpan epochKey2, - uint64_t epochStartTime2); }; class DLL_EXPORT GroupsCluster : public ClusterBase diff --git a/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp index 58e0af6bc431bc..dbcfc737576d37 100644 --- a/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp @@ -41,3910 +41,6 @@ namespace app { namespace Clusters { -namespace AccountLogin { - -void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::GetSetupPINResponse::Id: { - expectArgumentCount = 1; - chip::CharSpan setupPIN; - bool argExists[1]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 1) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(setupPIN); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - wasHandled = - emberAfAccountLoginClusterGetSetupPINResponseCallback(aCommandPath.mEndpointId, apCommandObj, setupPIN); - } - break; - } - default: { - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) - { - ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT - ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, - validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); - // A command with no arguments would never write currentDecodeTagId. If - // progress logging is also disabled, it would look unused. Silence that - // warning. - UNUSED_VAR(currentDecodeTagId); - } -} - -} // namespace AccountLogin - -namespace ApplicationLauncher { - -void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::LauncherResponse::Id: { - expectArgumentCount = 2; - uint8_t status; - chip::CharSpan data; - bool argExists[2]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 2) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(status); - break; - case 1: - TLVUnpackError = aDataTlv.Get(data); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - wasHandled = - emberAfApplicationLauncherClusterLauncherResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, data); - } - break; - } - default: { - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) - { - ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT - ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, - validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); - // A command with no arguments would never write currentDecodeTagId. If - // progress logging is also disabled, it would look unused. Silence that - // warning. - UNUSED_VAR(currentDecodeTagId); - } -} - -} // namespace ApplicationLauncher - -namespace Channel { - -void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::ChangeChannelResponse::Id: { - expectArgumentCount = 2; - chip::app::Clusters::Channel::Structs::ChannelInfo::DecodableType channelMatch; - uint8_t errorType; - bool argExists[2]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 2) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - // Not supported, just error out. - TLVUnpackError = CHIP_ERROR_UNEXPECTED_TLV_ELEMENT; - break; - case 1: - TLVUnpackError = aDataTlv.Get(errorType); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - wasHandled = emberAfChannelClusterChangeChannelResponseCallback(aCommandPath.mEndpointId, apCommandObj, - channelMatch, errorType); - } - break; - } - default: { - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) - { - ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT - ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, - validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); - // A command with no arguments would never write currentDecodeTagId. If - // progress logging is also disabled, it would look unused. Silence that - // warning. - UNUSED_VAR(currentDecodeTagId); - } -} - -} // namespace Channel - -namespace ContentLauncher { - -void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::LaunchResponse::Id: { - expectArgumentCount = 2; - uint8_t status; - chip::CharSpan data; - bool argExists[2]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 2) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(status); - break; - case 1: - TLVUnpackError = aDataTlv.Get(data); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - wasHandled = - emberAfContentLauncherClusterLaunchResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, data); - } - break; - } - default: { - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) - { - ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT - ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, - validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); - // A command with no arguments would never write currentDecodeTagId. If - // progress logging is also disabled, it would look unused. Silence that - // warning. - UNUSED_VAR(currentDecodeTagId); - } -} - -} // namespace ContentLauncher - -namespace DiagnosticLogs { - -void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::RetrieveLogsResponse::Id: { - expectArgumentCount = 4; - uint8_t status; - chip::ByteSpan content; - uint32_t timeStamp; - uint32_t timeSinceBoot; - bool argExists[4]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 4) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(status); - break; - case 1: - TLVUnpackError = aDataTlv.Get(content); - break; - case 2: - TLVUnpackError = aDataTlv.Get(timeStamp); - break; - case 3: - TLVUnpackError = aDataTlv.Get(timeSinceBoot); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) - { - wasHandled = emberAfDiagnosticLogsClusterRetrieveLogsResponseCallback(aCommandPath.mEndpointId, apCommandObj, - status, content, timeStamp, timeSinceBoot); - } - break; - } - default: { - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) - { - ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT - ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, - validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); - // A command with no arguments would never write currentDecodeTagId. If - // progress logging is also disabled, it would look unused. Silence that - // warning. - UNUSED_VAR(currentDecodeTagId); - } -} - -} // namespace DiagnosticLogs - -namespace DoorLock { - -void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::GetCredentialStatusResponse::Id: { - expectArgumentCount = 3; - bool credentialExists; - uint16_t userIndex; - uint16_t nextCredentialIndex; - bool argExists[3]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 3) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(credentialExists); - break; - case 1: - TLVUnpackError = aDataTlv.Get(userIndex); - break; - case 2: - TLVUnpackError = aDataTlv.Get(nextCredentialIndex); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) - { - wasHandled = emberAfDoorLockClusterGetCredentialStatusResponseCallback( - aCommandPath.mEndpointId, apCommandObj, credentialExists, userIndex, nextCredentialIndex); - } - break; - } - case Commands::GetUserResponse::Id: { - expectArgumentCount = 10; - uint16_t userIndex; - chip::CharSpan userName; - uint32_t userUniqueId; - uint8_t userStatus; - uint8_t userType; - uint8_t credentialRule; - /* TYPE WARNING: array array defaults to */ uint8_t * credentials; - chip::FabricIndex creatorFabricIndex; - chip::FabricIndex lastModifiedFabricIndex; - uint16_t nextUserIndex; - bool argExists[10]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 10) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(userIndex); - break; - case 1: - TLVUnpackError = aDataTlv.Get(userName); - break; - case 2: - TLVUnpackError = aDataTlv.Get(userUniqueId); - break; - case 3: - TLVUnpackError = aDataTlv.Get(userStatus); - break; - case 4: - TLVUnpackError = aDataTlv.Get(userType); - break; - case 5: - TLVUnpackError = aDataTlv.Get(credentialRule); - break; - case 6: - // Just for compatibility, we will add array type support in IM later. - TLVUnpackError = aDataTlv.GetDataPtr(const_cast(credentials)); - break; - case 7: - TLVUnpackError = aDataTlv.Get(creatorFabricIndex); - break; - case 8: - TLVUnpackError = aDataTlv.Get(lastModifiedFabricIndex); - break; - case 9: - TLVUnpackError = aDataTlv.Get(nextUserIndex); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 10 == validArgumentCount) - { - wasHandled = emberAfDoorLockClusterGetUserResponseCallback( - aCommandPath.mEndpointId, apCommandObj, userIndex, userName, userUniqueId, userStatus, userType, credentialRule, - credentials, creatorFabricIndex, lastModifiedFabricIndex, nextUserIndex); - } - break; - } - case Commands::GetWeekDayScheduleResponse::Id: { - expectArgumentCount = 8; - uint8_t weekDayIndex; - uint16_t userIndex; - uint8_t status; - uint8_t daysMask; - uint8_t startHour; - uint8_t startMinute; - uint8_t endHour; - uint8_t endMinute; - bool argExists[8]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 8) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(weekDayIndex); - break; - case 1: - TLVUnpackError = aDataTlv.Get(userIndex); - break; - case 2: - TLVUnpackError = aDataTlv.Get(status); - break; - case 3: - TLVUnpackError = aDataTlv.Get(daysMask); - break; - case 4: - TLVUnpackError = aDataTlv.Get(startHour); - break; - case 5: - TLVUnpackError = aDataTlv.Get(startMinute); - break; - case 6: - TLVUnpackError = aDataTlv.Get(endHour); - break; - case 7: - TLVUnpackError = aDataTlv.Get(endMinute); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 8 == validArgumentCount) - { - wasHandled = emberAfDoorLockClusterGetWeekDayScheduleResponseCallback(aCommandPath.mEndpointId, apCommandObj, - weekDayIndex, userIndex, status, daysMask, - startHour, startMinute, endHour, endMinute); - } - break; - } - case Commands::GetYearDayScheduleResponse::Id: { - expectArgumentCount = 5; - uint8_t yearDayIndex; - uint16_t userIndex; - uint8_t status; - uint32_t localStartTime; - uint32_t localEndTime; - bool argExists[5]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 5) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(yearDayIndex); - break; - case 1: - TLVUnpackError = aDataTlv.Get(userIndex); - break; - case 2: - TLVUnpackError = aDataTlv.Get(status); - break; - case 3: - TLVUnpackError = aDataTlv.Get(localStartTime); - break; - case 4: - TLVUnpackError = aDataTlv.Get(localEndTime); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) - { - wasHandled = emberAfDoorLockClusterGetYearDayScheduleResponseCallback( - aCommandPath.mEndpointId, apCommandObj, yearDayIndex, userIndex, status, localStartTime, localEndTime); - } - break; - } - case Commands::SetCredentialResponse::Id: { - expectArgumentCount = 3; - uint8_t status; - uint16_t userIndex; - uint16_t nextCredentialIndex; - bool argExists[3]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 3) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(status); - break; - case 1: - TLVUnpackError = aDataTlv.Get(userIndex); - break; - case 2: - TLVUnpackError = aDataTlv.Get(nextCredentialIndex); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) - { - wasHandled = emberAfDoorLockClusterSetCredentialResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, - userIndex, nextCredentialIndex); - } - break; - } - default: { - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) - { - ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT - ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, - validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); - // A command with no arguments would never write currentDecodeTagId. If - // progress logging is also disabled, it would look unused. Silence that - // warning. - UNUSED_VAR(currentDecodeTagId); - } -} - -} // namespace DoorLock - -namespace GeneralCommissioning { - -void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::ArmFailSafeResponse::Id: { - expectArgumentCount = 2; - uint8_t errorCode; - chip::CharSpan debugText; - bool argExists[2]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 2) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(errorCode); - break; - case 1: - TLVUnpackError = aDataTlv.Get(debugText); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - wasHandled = emberAfGeneralCommissioningClusterArmFailSafeResponseCallback(aCommandPath.mEndpointId, apCommandObj, - errorCode, debugText); - } - break; - } - case Commands::CommissioningCompleteResponse::Id: { - expectArgumentCount = 2; - uint8_t errorCode; - chip::CharSpan debugText; - bool argExists[2]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 2) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(errorCode); - break; - case 1: - TLVUnpackError = aDataTlv.Get(debugText); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - wasHandled = emberAfGeneralCommissioningClusterCommissioningCompleteResponseCallback( - aCommandPath.mEndpointId, apCommandObj, errorCode, debugText); - } - break; - } - case Commands::SetRegulatoryConfigResponse::Id: { - expectArgumentCount = 2; - uint8_t errorCode; - chip::CharSpan debugText; - bool argExists[2]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 2) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(errorCode); - break; - case 1: - TLVUnpackError = aDataTlv.Get(debugText); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - wasHandled = emberAfGeneralCommissioningClusterSetRegulatoryConfigResponseCallback( - aCommandPath.mEndpointId, apCommandObj, errorCode, debugText); - } - break; - } - default: { - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) - { - ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT - ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, - validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); - // A command with no arguments would never write currentDecodeTagId. If - // progress logging is also disabled, it would look unused. Silence that - // warning. - UNUSED_VAR(currentDecodeTagId); - } -} - -} // namespace GeneralCommissioning - -namespace GroupKeyManagement { - -void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::KeySetReadAllIndicesResponse::Id: { - expectArgumentCount = 1; - /* TYPE WARNING: array array defaults to */ uint8_t * GroupKeySetIDs; - bool argExists[1]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 1) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - // Just for compatibility, we will add array type support in IM later. - TLVUnpackError = aDataTlv.GetDataPtr(const_cast(GroupKeySetIDs)); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - wasHandled = emberAfGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback(aCommandPath.mEndpointId, - apCommandObj, GroupKeySetIDs); - } - break; - } - case Commands::KeySetReadResponse::Id: { - expectArgumentCount = 1; - chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::DecodableType GroupKeySet; - bool argExists[1]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 1) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - // Not supported, just error out. - TLVUnpackError = CHIP_ERROR_UNEXPECTED_TLV_ELEMENT; - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - wasHandled = - emberAfGroupKeyManagementClusterKeySetReadResponseCallback(aCommandPath.mEndpointId, apCommandObj, GroupKeySet); - } - break; - } - default: { - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) - { - ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT - ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, - validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); - // A command with no arguments would never write currentDecodeTagId. If - // progress logging is also disabled, it would look unused. Silence that - // warning. - UNUSED_VAR(currentDecodeTagId); - } -} - -} // namespace GroupKeyManagement - -namespace Groups { - -void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::AddGroupResponse::Id: { - expectArgumentCount = 2; - uint8_t status; - uint16_t groupId; - bool argExists[2]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 2) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(status); - break; - case 1: - TLVUnpackError = aDataTlv.Get(groupId); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - wasHandled = emberAfGroupsClusterAddGroupResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, groupId); - } - break; - } - case Commands::GetGroupMembershipResponse::Id: { - expectArgumentCount = 2; - uint8_t capacity; - /* TYPE WARNING: array array defaults to */ uint8_t * groupList; - bool argExists[2]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 2) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(capacity); - break; - case 1: - // Just for compatibility, we will add array type support in IM later. - TLVUnpackError = aDataTlv.GetDataPtr(const_cast(groupList)); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - wasHandled = emberAfGroupsClusterGetGroupMembershipResponseCallback(aCommandPath.mEndpointId, apCommandObj, - capacity, groupList); - } - break; - } - case Commands::RemoveGroupResponse::Id: { - expectArgumentCount = 2; - uint8_t status; - uint16_t groupId; - bool argExists[2]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 2) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(status); - break; - case 1: - TLVUnpackError = aDataTlv.Get(groupId); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - wasHandled = - emberAfGroupsClusterRemoveGroupResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, groupId); - } - break; - } - case Commands::ViewGroupResponse::Id: { - expectArgumentCount = 3; - uint8_t status; - uint16_t groupId; - chip::CharSpan groupName; - bool argExists[3]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 3) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(status); - break; - case 1: - TLVUnpackError = aDataTlv.Get(groupId); - break; - case 2: - TLVUnpackError = aDataTlv.Get(groupName); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) - { - wasHandled = emberAfGroupsClusterViewGroupResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, groupId, - groupName); - } - break; - } - default: { - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) - { - ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT - ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, - validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); - // A command with no arguments would never write currentDecodeTagId. If - // progress logging is also disabled, it would look unused. Silence that - // warning. - UNUSED_VAR(currentDecodeTagId); - } -} - -} // namespace Groups - -namespace Identify { - -void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::IdentifyQueryResponse::Id: { - expectArgumentCount = 1; - uint16_t timeout; - bool argExists[1]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 1) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(timeout); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - wasHandled = emberAfIdentifyClusterIdentifyQueryResponseCallback(aCommandPath.mEndpointId, apCommandObj, timeout); - } - break; - } - default: { - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) - { - ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT - ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, - validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); - // A command with no arguments would never write currentDecodeTagId. If - // progress logging is also disabled, it would look unused. Silence that - // warning. - UNUSED_VAR(currentDecodeTagId); - } -} - -} // namespace Identify - -namespace KeypadInput { - -void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::SendKeyResponse::Id: { - expectArgumentCount = 1; - uint8_t status; - bool argExists[1]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 1) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(status); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - wasHandled = emberAfKeypadInputClusterSendKeyResponseCallback(aCommandPath.mEndpointId, apCommandObj, status); - } - break; - } - default: { - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) - { - ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT - ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, - validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); - // A command with no arguments would never write currentDecodeTagId. If - // progress logging is also disabled, it would look unused. Silence that - // warning. - UNUSED_VAR(currentDecodeTagId); - } -} - -} // namespace KeypadInput - -namespace MediaPlayback { - -void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::PlaybackResponse::Id: { - expectArgumentCount = 1; - uint8_t status; - bool argExists[1]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 1) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(status); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - wasHandled = emberAfMediaPlaybackClusterPlaybackResponseCallback(aCommandPath.mEndpointId, apCommandObj, status); - } - break; - } - default: { - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) - { - ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT - ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, - validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); - // A command with no arguments would never write currentDecodeTagId. If - // progress logging is also disabled, it would look unused. Silence that - // warning. - UNUSED_VAR(currentDecodeTagId); - } -} - -} // namespace MediaPlayback - -namespace NetworkCommissioning { - -void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::ConnectNetworkResponse::Id: { - expectArgumentCount = 3; - uint8_t NetworkingStatus; - chip::CharSpan DebugText; - int32_t ErrorValue; - bool argExists[3]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 3) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(NetworkingStatus); - break; - case 1: - TLVUnpackError = aDataTlv.Get(DebugText); - break; - case 2: - TLVUnpackError = aDataTlv.Get(ErrorValue); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) - { - wasHandled = emberAfNetworkCommissioningClusterConnectNetworkResponseCallback( - aCommandPath.mEndpointId, apCommandObj, NetworkingStatus, DebugText, ErrorValue); - } - break; - } - case Commands::NetworkConfigResponse::Id: { - expectArgumentCount = 2; - uint8_t NetworkingStatus; - chip::CharSpan DebugText; - bool argExists[2]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 2) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(NetworkingStatus); - break; - case 1: - TLVUnpackError = aDataTlv.Get(DebugText); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - wasHandled = emberAfNetworkCommissioningClusterNetworkConfigResponseCallback(aCommandPath.mEndpointId, apCommandObj, - NetworkingStatus, DebugText); - } - break; - } - case Commands::ScanNetworksResponse::Id: { - expectArgumentCount = 4; - uint8_t NetworkingStatus; - chip::CharSpan DebugText; - /* TYPE WARNING: array array defaults to */ uint8_t * WiFiScanResults; - /* TYPE WARNING: array array defaults to */ uint8_t * ThreadScanResults; - bool argExists[4]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 4) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(NetworkingStatus); - break; - case 1: - TLVUnpackError = aDataTlv.Get(DebugText); - break; - case 2: - // Just for compatibility, we will add array type support in IM later. - TLVUnpackError = aDataTlv.GetDataPtr(const_cast(WiFiScanResults)); - break; - case 3: - // Just for compatibility, we will add array type support in IM later. - TLVUnpackError = aDataTlv.GetDataPtr(const_cast(ThreadScanResults)); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) - { - wasHandled = emberAfNetworkCommissioningClusterScanNetworksResponseCallback( - aCommandPath.mEndpointId, apCommandObj, NetworkingStatus, DebugText, WiFiScanResults, ThreadScanResults); - } - break; - } - default: { - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) - { - ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT - ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, - validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); - // A command with no arguments would never write currentDecodeTagId. If - // progress logging is also disabled, it would look unused. Silence that - // warning. - UNUSED_VAR(currentDecodeTagId); - } -} - -} // namespace NetworkCommissioning - -namespace OtaSoftwareUpdateProvider { - -void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::ApplyUpdateResponse::Id: { - expectArgumentCount = 2; - uint8_t action; - uint32_t delayedActionTime; - bool argExists[2]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 2) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(action); - break; - case 1: - TLVUnpackError = aDataTlv.Get(delayedActionTime); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - wasHandled = emberAfOtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback( - aCommandPath.mEndpointId, apCommandObj, action, delayedActionTime); - } - break; - } - case Commands::QueryImageResponse::Id: { - expectArgumentCount = 8; - uint8_t status; - uint32_t delayedActionTime; - chip::CharSpan imageURI; - uint32_t softwareVersion; - chip::CharSpan softwareVersionString; - chip::ByteSpan updateToken; - bool userConsentNeeded; - chip::ByteSpan metadataForRequestor; - bool argExists[8]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 8) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(status); - break; - case 1: - TLVUnpackError = aDataTlv.Get(delayedActionTime); - break; - case 2: - TLVUnpackError = aDataTlv.Get(imageURI); - break; - case 3: - TLVUnpackError = aDataTlv.Get(softwareVersion); - break; - case 4: - TLVUnpackError = aDataTlv.Get(softwareVersionString); - break; - case 5: - TLVUnpackError = aDataTlv.Get(updateToken); - break; - case 6: - TLVUnpackError = aDataTlv.Get(userConsentNeeded); - break; - case 7: - TLVUnpackError = aDataTlv.Get(metadataForRequestor); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 8 == validArgumentCount) - { - wasHandled = emberAfOtaSoftwareUpdateProviderClusterQueryImageResponseCallback( - aCommandPath.mEndpointId, apCommandObj, status, delayedActionTime, imageURI, softwareVersion, - softwareVersionString, updateToken, userConsentNeeded, metadataForRequestor); - } - break; - } - default: { - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) - { - ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT - ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, - validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); - // A command with no arguments would never write currentDecodeTagId. If - // progress logging is also disabled, it would look unused. Silence that - // warning. - UNUSED_VAR(currentDecodeTagId); - } -} - -} // namespace OtaSoftwareUpdateProvider - -namespace OperationalCredentials { - -void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::AttestationResponse::Id: { - expectArgumentCount = 2; - chip::ByteSpan AttestationElements; - chip::ByteSpan Signature; - bool argExists[2]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 2) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(AttestationElements); - break; - case 1: - TLVUnpackError = aDataTlv.Get(Signature); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - wasHandled = emberAfOperationalCredentialsClusterAttestationResponseCallback(aCommandPath.mEndpointId, apCommandObj, - AttestationElements, Signature); - } - break; - } - case Commands::CertificateChainResponse::Id: { - expectArgumentCount = 1; - chip::ByteSpan Certificate; - bool argExists[1]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 1) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(Certificate); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - wasHandled = emberAfOperationalCredentialsClusterCertificateChainResponseCallback(aCommandPath.mEndpointId, - apCommandObj, Certificate); - } - break; - } - case Commands::NOCResponse::Id: { - expectArgumentCount = 3; - uint8_t StatusCode; - uint8_t FabricIndex; - chip::CharSpan DebugText; - bool argExists[3]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 3) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(StatusCode); - break; - case 1: - TLVUnpackError = aDataTlv.Get(FabricIndex); - break; - case 2: - TLVUnpackError = aDataTlv.Get(DebugText); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) - { - wasHandled = emberAfOperationalCredentialsClusterNOCResponseCallback(aCommandPath.mEndpointId, apCommandObj, - StatusCode, FabricIndex, DebugText); - } - break; - } - case Commands::OpCSRResponse::Id: { - expectArgumentCount = 2; - chip::ByteSpan NOCSRElements; - chip::ByteSpan AttestationSignature; - bool argExists[2]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 2) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(NOCSRElements); - break; - case 1: - TLVUnpackError = aDataTlv.Get(AttestationSignature); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - wasHandled = emberAfOperationalCredentialsClusterOpCSRResponseCallback(aCommandPath.mEndpointId, apCommandObj, - NOCSRElements, AttestationSignature); - } - break; - } - default: { - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) - { - ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT - ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, - validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); - // A command with no arguments would never write currentDecodeTagId. If - // progress logging is also disabled, it would look unused. Silence that - // warning. - UNUSED_VAR(currentDecodeTagId); - } -} - -} // namespace OperationalCredentials - -namespace Scenes { - -void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::AddSceneResponse::Id: { - expectArgumentCount = 3; - uint8_t status; - uint16_t groupId; - uint8_t sceneId; - bool argExists[3]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 3) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(status); - break; - case 1: - TLVUnpackError = aDataTlv.Get(groupId); - break; - case 2: - TLVUnpackError = aDataTlv.Get(sceneId); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) - { - wasHandled = - emberAfScenesClusterAddSceneResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, groupId, sceneId); - } - break; - } - case Commands::GetSceneMembershipResponse::Id: { - expectArgumentCount = 5; - uint8_t status; - uint8_t capacity; - uint16_t groupId; - uint8_t sceneCount; - /* TYPE WARNING: array array defaults to */ uint8_t * sceneList; - bool argExists[5]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 5) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(status); - break; - case 1: - TLVUnpackError = aDataTlv.Get(capacity); - break; - case 2: - TLVUnpackError = aDataTlv.Get(groupId); - break; - case 3: - TLVUnpackError = aDataTlv.Get(sceneCount); - break; - case 4: - // Just for compatibility, we will add array type support in IM later. - TLVUnpackError = aDataTlv.GetDataPtr(const_cast(sceneList)); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) - { - wasHandled = emberAfScenesClusterGetSceneMembershipResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, - capacity, groupId, sceneCount, sceneList); - } - break; - } - case Commands::RemoveAllScenesResponse::Id: { - expectArgumentCount = 2; - uint8_t status; - uint16_t groupId; - bool argExists[2]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 2) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(status); - break; - case 1: - TLVUnpackError = aDataTlv.Get(groupId); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - wasHandled = - emberAfScenesClusterRemoveAllScenesResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, groupId); - } - break; - } - case Commands::RemoveSceneResponse::Id: { - expectArgumentCount = 3; - uint8_t status; - uint16_t groupId; - uint8_t sceneId; - bool argExists[3]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 3) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(status); - break; - case 1: - TLVUnpackError = aDataTlv.Get(groupId); - break; - case 2: - TLVUnpackError = aDataTlv.Get(sceneId); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) - { - wasHandled = emberAfScenesClusterRemoveSceneResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, - groupId, sceneId); - } - break; - } - case Commands::StoreSceneResponse::Id: { - expectArgumentCount = 3; - uint8_t status; - uint16_t groupId; - uint8_t sceneId; - bool argExists[3]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 3) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(status); - break; - case 1: - TLVUnpackError = aDataTlv.Get(groupId); - break; - case 2: - TLVUnpackError = aDataTlv.Get(sceneId); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) - { - wasHandled = emberAfScenesClusterStoreSceneResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, groupId, - sceneId); - } - break; - } - case Commands::ViewSceneResponse::Id: { - expectArgumentCount = 6; - uint8_t status; - uint16_t groupId; - uint8_t sceneId; - uint16_t transitionTime; - chip::CharSpan sceneName; - /* TYPE WARNING: array array defaults to */ uint8_t * extensionFieldSets; - bool argExists[6]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 6) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(status); - break; - case 1: - TLVUnpackError = aDataTlv.Get(groupId); - break; - case 2: - TLVUnpackError = aDataTlv.Get(sceneId); - break; - case 3: - TLVUnpackError = aDataTlv.Get(transitionTime); - break; - case 4: - TLVUnpackError = aDataTlv.Get(sceneName); - break; - case 5: - // Just for compatibility, we will add array type support in IM later. - TLVUnpackError = aDataTlv.GetDataPtr(const_cast(extensionFieldSets)); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 6 == validArgumentCount) - { - wasHandled = emberAfScenesClusterViewSceneResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, groupId, - sceneId, transitionTime, sceneName, extensionFieldSets); - } - break; - } - default: { - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) - { - ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT - ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, - validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); - // A command with no arguments would never write currentDecodeTagId. If - // progress logging is also disabled, it would look unused. Silence that - // warning. - UNUSED_VAR(currentDecodeTagId); - } -} - -} // namespace Scenes - -namespace TargetNavigator { - -void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::NavigateTargetResponse::Id: { - expectArgumentCount = 2; - uint8_t status; - chip::CharSpan data; - bool argExists[2]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 2) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(status); - break; - case 1: - TLVUnpackError = aDataTlv.Get(data); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - wasHandled = emberAfTargetNavigatorClusterNavigateTargetResponseCallback(aCommandPath.mEndpointId, apCommandObj, - status, data); - } - break; - } - default: { - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) - { - ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT - ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, - validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); - // A command with no arguments would never write currentDecodeTagId. If - // progress logging is also disabled, it would look unused. Silence that - // warning. - UNUSED_VAR(currentDecodeTagId); - } -} - -} // namespace TargetNavigator - -namespace TestCluster { - -void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::BooleanResponse::Id: { - expectArgumentCount = 1; - bool value; - bool argExists[1]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 1) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(value); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - wasHandled = emberAfTestClusterClusterBooleanResponseCallback(aCommandPath.mEndpointId, apCommandObj, value); - } - break; - } - case Commands::SimpleStructResponse::Id: { - expectArgumentCount = 1; - chip::app::Clusters::TestCluster::Structs::SimpleStruct::DecodableType arg1; - bool argExists[1]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 1) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - // Not supported, just error out. - TLVUnpackError = CHIP_ERROR_UNEXPECTED_TLV_ELEMENT; - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - wasHandled = emberAfTestClusterClusterSimpleStructResponseCallback(aCommandPath.mEndpointId, apCommandObj, arg1); - } - break; - } - case Commands::TestAddArgumentsResponse::Id: { - expectArgumentCount = 1; - uint8_t returnValue; - bool argExists[1]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 1) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(returnValue); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - wasHandled = - emberAfTestClusterClusterTestAddArgumentsResponseCallback(aCommandPath.mEndpointId, apCommandObj, returnValue); - } - break; - } - case Commands::TestEmitTestEventResponse::Id: { - expectArgumentCount = 1; - uint64_t value; - bool argExists[1]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 1) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(value); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - wasHandled = - emberAfTestClusterClusterTestEmitTestEventResponseCallback(aCommandPath.mEndpointId, apCommandObj, value); - } - break; - } - case Commands::TestEnumsResponse::Id: { - expectArgumentCount = 2; - chip::VendorId arg1; - uint8_t arg2; - bool argExists[2]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 2) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(arg1); - break; - case 1: - TLVUnpackError = aDataTlv.Get(arg2); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - wasHandled = emberAfTestClusterClusterTestEnumsResponseCallback(aCommandPath.mEndpointId, apCommandObj, arg1, arg2); - } - break; - } - case Commands::TestListInt8UReverseResponse::Id: { - expectArgumentCount = 1; - /* TYPE WARNING: array array defaults to */ uint8_t * arg1; - bool argExists[1]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 1) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - // Just for compatibility, we will add array type support in IM later. - TLVUnpackError = aDataTlv.GetDataPtr(const_cast(arg1)); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - wasHandled = - emberAfTestClusterClusterTestListInt8UReverseResponseCallback(aCommandPath.mEndpointId, apCommandObj, arg1); - } - break; - } - case Commands::TestNullableOptionalResponse::Id: { - expectArgumentCount = 4; - bool wasPresent; - bool wasNull; - uint8_t value; - uint8_t originalValue; - bool argExists[4]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 4) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(wasPresent); - break; - case 1: - TLVUnpackError = aDataTlv.Get(wasNull); - break; - case 2: - TLVUnpackError = aDataTlv.Get(value); - break; - case 3: - TLVUnpackError = aDataTlv.Get(originalValue); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) - { - wasHandled = emberAfTestClusterClusterTestNullableOptionalResponseCallback( - aCommandPath.mEndpointId, apCommandObj, wasPresent, wasNull, value, originalValue); - } - break; - } - case Commands::TestSpecificResponse::Id: { - expectArgumentCount = 1; - uint8_t returnValue; - bool argExists[1]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 1) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(returnValue); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - wasHandled = - emberAfTestClusterClusterTestSpecificResponseCallback(aCommandPath.mEndpointId, apCommandObj, returnValue); - } - break; - } - default: { - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) - { - ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT - ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, - validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); - // A command with no arguments would never write currentDecodeTagId. If - // progress logging is also disabled, it would look unused. Silence that - // warning. - UNUSED_VAR(currentDecodeTagId); - } -} - -} // namespace TestCluster - -namespace Thermostat { - -void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::GetRelayStatusLogResponse::Id: { - expectArgumentCount = 6; - uint16_t timeOfDay; - uint16_t relayStatus; - int16_t localTemperature; - uint8_t humidityInPercentage; - int16_t setpoint; - uint16_t unreadEntries; - bool argExists[6]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 6) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(timeOfDay); - break; - case 1: - TLVUnpackError = aDataTlv.Get(relayStatus); - break; - case 2: - TLVUnpackError = aDataTlv.Get(localTemperature); - break; - case 3: - TLVUnpackError = aDataTlv.Get(humidityInPercentage); - break; - case 4: - TLVUnpackError = aDataTlv.Get(setpoint); - break; - case 5: - TLVUnpackError = aDataTlv.Get(unreadEntries); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 6 == validArgumentCount) - { - wasHandled = emberAfThermostatClusterGetRelayStatusLogResponseCallback( - aCommandPath.mEndpointId, apCommandObj, timeOfDay, relayStatus, localTemperature, humidityInPercentage, - setpoint, unreadEntries); - } - break; - } - case Commands::GetWeeklyScheduleResponse::Id: { - expectArgumentCount = 4; - uint8_t numberOfTransitionsForSequence; - uint8_t dayOfWeekForSequence; - uint8_t modeForSequence; - /* TYPE WARNING: array array defaults to */ uint8_t * payload; - bool argExists[4]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 4) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(numberOfTransitionsForSequence); - break; - case 1: - TLVUnpackError = aDataTlv.Get(dayOfWeekForSequence); - break; - case 2: - TLVUnpackError = aDataTlv.Get(modeForSequence); - break; - case 3: - // Just for compatibility, we will add array type support in IM later. - TLVUnpackError = aDataTlv.GetDataPtr(const_cast(payload)); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) - { - wasHandled = emberAfThermostatClusterGetWeeklyScheduleResponseCallback( - aCommandPath.mEndpointId, apCommandObj, numberOfTransitionsForSequence, dayOfWeekForSequence, modeForSequence, - payload); - } - break; - } - default: { - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) - { - ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT - ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, - validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); - // A command with no arguments would never write currentDecodeTagId. If - // progress logging is also disabled, it would look unused. Silence that - // warning. - UNUSED_VAR(currentDecodeTagId); - } -} - -} // namespace Thermostat - } // namespace Clusters void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aReader, CommandHandler * apCommandObj) diff --git a/zzz_generated/controller-clusters/zap-generated/endpoint_config.h b/zzz_generated/controller-clusters/zap-generated/endpoint_config.h index 0009837a26e094..4b9a1f91dab8b6 100644 --- a/zzz_generated/controller-clusters/zap-generated/endpoint_config.h +++ b/zzz_generated/controller-clusters/zap-generated/endpoint_config.h @@ -97,7 +97,7 @@ \ /* Endpoint: 1, Cluster: Access Control (client) */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(CLIENT) | ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Bridged Actions (client) */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ diff --git a/zzz_generated/door-lock-app/zap-generated/endpoint_config.h b/zzz_generated/door-lock-app/zap-generated/endpoint_config.h index cd4757fb64be4e..5cdcfb19447681 100644 --- a/zzz_generated/door-lock-app/zap-generated/endpoint_config.h +++ b/zzz_generated/door-lock-app/zap-generated/endpoint_config.h @@ -597,12 +597,11 @@ { \ \ /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Access Control (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -824,11 +823,11 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { 0x00000000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* WindowStatus */ \ + { 0x00000000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ { 0x00000001, ZAP_TYPE(FABRIC_IDX), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* AdminVendorId */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ @@ -851,12 +850,11 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Power Source (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(1) }, /* Status */ \ diff --git a/zzz_generated/lighting-app/zap-generated/endpoint_config.h b/zzz_generated/lighting-app/zap-generated/endpoint_config.h index bb15c7dbb33671..c3b226c80dcf16 100644 --- a/zzz_generated/lighting-app/zap-generated/endpoint_config.h +++ b/zzz_generated/lighting-app/zap-generated/endpoint_config.h @@ -562,13 +562,16 @@ #define GENERATED_ATTRIBUTES \ { \ \ - /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + /* Endpoint: 0, Cluster: Groups (server) */ \ + { 0x00000000, ZAP_TYPE(BITMAP8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* name support */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ + \ + /* Endpoint: 0, Cluster: Descriptor (server) */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Access Control (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -622,7 +625,7 @@ \ /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_SIMPLE_DEFAULT(0) }, /* DefaultOtaProviders */ \ + ZAP_EMPTY_DEFAULT() }, /* DefaultOtaProviders */ \ { 0x00000001, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(1) }, /* UpdatePossible */ \ { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* UpdateState */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0) }, /* UpdateStateProgress */ \ @@ -786,11 +789,11 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { 0x00000000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* WindowStatus */ \ + { 0x00000000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ { 0x00000001, ZAP_TYPE(FABRIC_IDX), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* AdminVendorId */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ @@ -859,12 +862,11 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Color Control (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current hue */ \ @@ -1103,126 +1105,331 @@ #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask #define GENERATED_CLUSTER_COUNT 29 -#define GENERATED_CLUSTERS \ - { \ - { 0x00000004, \ - ZAP_ATTRIBUTE_INDEX(0), \ - 2, \ - 3, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayGroupsServer }, /* Endpoint: 0, Cluster: Groups (server) */ \ - { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(2), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { 0x00000028, \ - ZAP_ATTRIBUTE_INDEX(7), \ - 20, \ - 39, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayBasicServer }, /* Endpoint: 0, Cluster: Basic (server) */ \ - { \ - 0x00000029, ZAP_ATTRIBUTE_INDEX(27), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 0, Cluster: OTA Software Update Provider (client) */ \ - { \ - 0x0000002A, ZAP_ATTRIBUTE_INDEX(28), 5, 5, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */ \ - { 0x0000002B, \ - ZAP_ATTRIBUTE_INDEX(33), \ - 3, \ - 38, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayLocalizationConfigurationServer }, /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ - { 0x0000002C, \ - ZAP_ATTRIBUTE_INDEX(36), \ - 4, \ - 4, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayTimeFormatLocalizationServer }, /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ - { \ - 0x00000030, ZAP_ATTRIBUTE_INDEX(38), 6, 270, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { \ - 0x00000031, ZAP_ATTRIBUTE_INDEX(44), 10, 60, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { \ - 0x00000032, ZAP_ATTRIBUTE_INDEX(56), 0, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ - { \ - 0x00000033, ZAP_ATTRIBUTE_INDEX(56), 9, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ - { \ - 0x00000034, ZAP_ATTRIBUTE_INDEX(65), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { \ - 0x00000035, ZAP_ATTRIBUTE_INDEX(71), 65, 247, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { \ - 0x00000036, ZAP_ATTRIBUTE_INDEX(136), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ - { \ - 0x00000037, ZAP_ATTRIBUTE_INDEX(151), 11, 57, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ - { \ - 0x0000003B, ZAP_ATTRIBUTE_INDEX(162), 0, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Switch (server) */ \ - { \ - 0x0000003C, ZAP_ATTRIBUTE_INDEX(162), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(166), 7, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(173), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ - { \ - 0x00000041, ZAP_ATTRIBUTE_INDEX(175), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: User Label (server) */ \ - { 0x00000003, \ - ZAP_ATTRIBUTE_INDEX(177), \ - 3, \ - 5, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayIdentifyServer }, /* Endpoint: 1, Cluster: Identify (server) */ \ - { 0x00000004, \ - ZAP_ATTRIBUTE_INDEX(180), \ - 2, \ - 3, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayGroupsServer }, /* Endpoint: 1, Cluster: Groups (server) */ \ - { 0x00000006, \ - ZAP_ATTRIBUTE_INDEX(182), \ - 7, \ - 13, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ - { 0x00000008, \ - ZAP_ATTRIBUTE_INDEX(189), \ - 16, \ - 27, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ - { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(205), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ - { 0x00000300, \ - ZAP_ATTRIBUTE_INDEX(210), \ - 22, \ - 36, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayColorControlServer }, /* Endpoint: 1, Cluster: Color Control (server) */ \ - { 0x00000406, \ - ZAP_ATTRIBUTE_INDEX(232), \ - 4, \ - 5, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayOccupancySensingServer }, /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ - { \ - 0x00000006, ZAP_ATTRIBUTE_INDEX(236), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 2, Cluster: On/Off (client) */ \ - { \ - 0x00000007, ZAP_ATTRIBUTE_INDEX(237), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 2, Cluster: On/off Switch Configuration (server) */ \ - } + +// clang-format off +#define GENERATED_CLUSTERS { \ + { \ + /* Endpoint: 0, Cluster: Groups (server) */ \ + .clusterId = 0x00000004, \ + .attributes = ZAP_ATTRIBUTE_INDEX(0), \ + .attributeCount = 2, \ + .clusterSize = 3, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayGroupsServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 0 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 7 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Descriptor (server) */ \ + .clusterId = 0x0000001D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(2), \ + .attributeCount = 5, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Basic (server) */ \ + .clusterId = 0x00000028, \ + .attributes = ZAP_ATTRIBUTE_INDEX(7), \ + .attributeCount = 20, \ + .clusterSize = 39, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayBasicServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: OTA Software Update Provider (client) */ \ + .clusterId = 0x00000029, \ + .attributes = ZAP_ATTRIBUTE_INDEX(27), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 12 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 16 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */ \ + .clusterId = 0x0000002A, \ + .attributes = ZAP_ATTRIBUTE_INDEX(28), \ + .attributeCount = 5, \ + .clusterSize = 5, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 19 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ + .clusterId = 0x0000002B, \ + .attributes = ZAP_ATTRIBUTE_INDEX(33), \ + .attributeCount = 3, \ + .clusterSize = 38, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayLocalizationConfigurationServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ + .clusterId = 0x0000002C, \ + .attributes = ZAP_ATTRIBUTE_INDEX(36), \ + .attributeCount = 4, \ + .clusterSize = 4, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayTimeFormatLocalizationServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: General Commissioning (server) */ \ + .clusterId = 0x00000030, \ + .attributes = ZAP_ATTRIBUTE_INDEX(40), \ + .attributeCount = 6, \ + .clusterSize = 270, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 21 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 25 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ + .clusterId = 0x00000031, \ + .attributes = ZAP_ATTRIBUTE_INDEX(46), \ + .attributeCount = 10, \ + .clusterSize = 60, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 28 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 35 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ + .clusterId = 0x00000032, \ + .attributes = ZAP_ATTRIBUTE_INDEX(56), \ + .attributeCount = 0, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 38 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ + .clusterId = 0x00000033, \ + .attributes = ZAP_ATTRIBUTE_INDEX(56), \ + .attributeCount = 9, \ + .clusterSize = 17, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ + .clusterId = 0x00000034, \ + .attributes = ZAP_ATTRIBUTE_INDEX(65), \ + .attributeCount = 6, \ + .clusterSize = 30, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 40 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ + .clusterId = 0x00000035, \ + .attributes = ZAP_ATTRIBUTE_INDEX(71), \ + .attributeCount = 65, \ + .clusterSize = 247, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 42 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ + .clusterId = 0x00000036, \ + .attributes = ZAP_ATTRIBUTE_INDEX(136), \ + .attributeCount = 15, \ + .clusterSize = 58, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 44 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ + .clusterId = 0x00000037, \ + .attributes = ZAP_ATTRIBUTE_INDEX(151), \ + .attributeCount = 11, \ + .clusterSize = 57, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 46 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Switch (server) */ \ + .clusterId = 0x0000003B, \ + .attributes = ZAP_ATTRIBUTE_INDEX(162), \ + .attributeCount = 0, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ + .clusterId = 0x0000003C, \ + .attributes = ZAP_ATTRIBUTE_INDEX(162), \ + .attributeCount = 4, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 48 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ + .clusterId = 0x0000003E, \ + .attributes = ZAP_ATTRIBUTE_INDEX(166), \ + .attributeCount = 7, \ + .clusterSize = 4, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 52 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 62 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Fixed Label (server) */ \ + .clusterId = 0x00000040, \ + .attributes = ZAP_ATTRIBUTE_INDEX(173), \ + .attributeCount = 2, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: User Label (server) */ \ + .clusterId = 0x00000041, \ + .attributes = ZAP_ATTRIBUTE_INDEX(175), \ + .attributeCount = 2, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Identify (server) */ \ + .clusterId = 0x00000003, \ + .attributes = ZAP_ATTRIBUTE_INDEX(177), \ + .attributeCount = 3, \ + .clusterSize = 5, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayIdentifyServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 67 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 71 ) ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Groups (server) */ \ + .clusterId = 0x00000004, \ + .attributes = ZAP_ATTRIBUTE_INDEX(180), \ + .attributeCount = 2, \ + .clusterSize = 3, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayGroupsServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 73 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 80 ) ,\ + },\ + { \ + /* Endpoint: 1, Cluster: On/Off (server) */ \ + .clusterId = 0x00000006, \ + .attributes = ZAP_ATTRIBUTE_INDEX(182), \ + .attributeCount = 7, \ + .clusterSize = 13, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayOnOffServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 85 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Level Control (server) */ \ + .clusterId = 0x00000008, \ + .attributes = ZAP_ATTRIBUTE_INDEX(189), \ + .attributeCount = 16, \ + .clusterSize = 27, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayLevelControlServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 92 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Descriptor (server) */ \ + .clusterId = 0x0000001D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(205), \ + .attributeCount = 5, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Color Control (server) */ \ + .clusterId = 0x00000300, \ + .attributes = ZAP_ATTRIBUTE_INDEX(210), \ + .attributeCount = 22, \ + .clusterSize = 36, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayColorControlServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 101 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ + .clusterId = 0x00000406, \ + .attributes = ZAP_ATTRIBUTE_INDEX(232), \ + .attributeCount = 4, \ + .clusterSize = 5, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayOccupancySensingServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 2, Cluster: On/Off (client) */ \ + .clusterId = 0x00000006, \ + .attributes = ZAP_ATTRIBUTE_INDEX(236), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 121 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 2, Cluster: On/off Switch Configuration (server) */ \ + .clusterId = 0x00000007, \ + .attributes = ZAP_ATTRIBUTE_INDEX(237), \ + .attributeCount = 3, \ + .clusterSize = 4, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ +} + +// clang-format on #define ZAP_CLUSTER_INDEX(index) (&generatedClusters[index]) @@ -1231,7 +1438,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 19, 1485 }, { ZAP_CLUSTER_INDEX(19), 6, 86 }, { ZAP_CLUSTER_INDEX(25), 2, 6 }, \ + { ZAP_CLUSTER_INDEX(0), 20, 840 }, { ZAP_CLUSTER_INDEX(20), 7, 89 }, { ZAP_CLUSTER_INDEX(27), 2, 6 }, \ } // Largest attribute size is needed for various buffers @@ -1241,7 +1448,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (39) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (1577) +#define ATTRIBUTE_MAX_SIZE (935) // 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 ad7211b81d55fc..a3cecdce62f0cf 100644 --- a/zzz_generated/lock-app/zap-generated/endpoint_config.h +++ b/zzz_generated/lock-app/zap-generated/endpoint_config.h @@ -579,12 +579,11 @@ { \ \ /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Access Control (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -806,11 +805,11 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { 0x00000000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* WindowStatus */ \ + { 0x00000000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ { 0x00000001, ZAP_TYPE(FABRIC_IDX), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* AdminVendorId */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ @@ -842,12 +841,11 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Power Source (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(1) }, /* Status */ \ diff --git a/zzz_generated/ota-provider-app/zap-generated/endpoint_config.h b/zzz_generated/ota-provider-app/zap-generated/endpoint_config.h index 961e9b6d802475..5723691a9e4912 100644 --- a/zzz_generated/ota-provider-app/zap-generated/endpoint_config.h +++ b/zzz_generated/ota-provider-app/zap-generated/endpoint_config.h @@ -133,10 +133,9 @@ \ /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ { 0x00000001, ZAP_TYPE(CHAR_STRING), 36, ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(0) }, /* ActiveLocale */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(0) }, /* SupportedLocales */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + ZAP_LONG_DEFAULTS_INDEX(0) }, /* ActiveLocale */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SupportedLocales */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, \ diff --git a/zzz_generated/ota-requestor-app/zap-generated/endpoint_config.h b/zzz_generated/ota-requestor-app/zap-generated/endpoint_config.h index 63823857b09822..bf9f2977a9344c 100644 --- a/zzz_generated/ota-requestor-app/zap-generated/endpoint_config.h +++ b/zzz_generated/ota-requestor-app/zap-generated/endpoint_config.h @@ -172,7 +172,7 @@ \ /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_SIMPLE_DEFAULT(0) }, /* DefaultOtaProviders */ \ + ZAP_EMPTY_DEFAULT() }, /* DefaultOtaProviders */ \ { 0x00000001, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(1) }, /* UpdatePossible */ \ { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* UpdateState */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0) }, /* UpdateStateProgress */ \ @@ -180,10 +180,9 @@ \ /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ { 0x00000001, ZAP_TYPE(CHAR_STRING), 36, ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(24) }, /* ActiveLocale */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(0) }, /* SupportedLocales */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + ZAP_LONG_DEFAULTS_INDEX(0) }, /* ActiveLocale */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SupportedLocales */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, \ diff --git a/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h b/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h index e0444fac3adfd2..dc5f79cc56f017 100644 --- a/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h +++ b/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h @@ -150,12 +150,11 @@ { \ \ /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Basic (server) */ \ { 0x00000000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(10) }, /* DataModelRevision */ \ diff --git a/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h b/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h index e0444fac3adfd2..dc5f79cc56f017 100644 --- a/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h +++ b/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h @@ -150,12 +150,11 @@ { \ \ /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Basic (server) */ \ { 0x00000000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(10) }, /* DataModelRevision */ \ diff --git a/zzz_generated/pump-app/zap-generated/endpoint_config.h b/zzz_generated/pump-app/zap-generated/endpoint_config.h index 72b0ad8d8d72e2..dc0d716a9de732 100644 --- a/zzz_generated/pump-app/zap-generated/endpoint_config.h +++ b/zzz_generated/pump-app/zap-generated/endpoint_config.h @@ -42,7 +42,7 @@ /* 10 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 38 - BasicCommissioningInfoList, */ \ + /* 18 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -58,185 +58,185 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 292 - FeatureMap, */ \ + /* 272 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x06, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), big-endian */ \ \ - /* 296 - Networks, */ \ + /* 276 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 308 - LastConnectErrorValue, */ \ + /* 288 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 312 - FeatureMap, */ \ + /* 292 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), big-endian */ \ \ - /* 316 - UpTime, */ \ + /* 296 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 324 - TotalOperationalHours, */ \ + /* 304 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), big-endian */ \ \ - /* 328 - CurrentHeapFree, */ \ + /* 308 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 336 - CurrentHeapUsed, */ \ + /* 316 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 344 - CurrentHeapHighWatermark, */ \ + /* 324 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 352 - FeatureMap, */ \ + /* 332 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), big-endian */ \ \ - /* 356 - NetworkName, */ \ + /* 336 - NetworkName, */ \ 0x00, 0x00, \ \ - /* 358 - ExtendedPanId, */ \ + /* 338 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 366 - OverrunCount, */ \ + /* 346 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 374 - PartitionId, */ \ + /* 354 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 378 - TxTotalCount, */ \ + /* 358 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 382 - TxUnicastCount, */ \ + /* 362 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 386 - TxBroadcastCount, */ \ + /* 366 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 390 - TxAckRequestedCount, */ \ + /* 370 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 394 - TxAckedCount, */ \ + /* 374 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 398 - TxNoAckRequestedCount, */ \ + /* 378 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 402 - TxDataCount, */ \ + /* 382 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 406 - TxDataPollCount, */ \ + /* 386 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 410 - TxBeaconCount, */ \ + /* 390 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 414 - TxBeaconRequestCount, */ \ + /* 394 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 418 - TxOtherCount, */ \ + /* 398 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 422 - TxRetryCount, */ \ + /* 402 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 426 - TxDirectMaxRetryExpiryCount, */ \ + /* 406 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 430 - TxIndirectMaxRetryExpiryCount, */ \ + /* 410 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 434 - TxErrCcaCount, */ \ + /* 414 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 438 - TxErrAbortCount, */ \ + /* 418 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 442 - TxErrBusyChannelCount, */ \ + /* 422 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 446 - RxTotalCount, */ \ + /* 426 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 450 - RxUnicastCount, */ \ + /* 430 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 454 - RxBroadcastCount, */ \ + /* 434 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 458 - RxDataCount, */ \ + /* 438 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 462 - RxDataPollCount, */ \ + /* 442 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 466 - RxBeaconCount, */ \ + /* 446 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 470 - RxBeaconRequestCount, */ \ + /* 450 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 474 - RxOtherCount, */ \ + /* 454 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 478 - RxAddressFilteredCount, */ \ + /* 458 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 482 - RxDestAddrFilteredCount, */ \ + /* 462 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 486 - RxDuplicatedCount, */ \ + /* 466 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 490 - RxErrNoFrameCount, */ \ + /* 470 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 494 - RxErrUnknownNeighborCount, */ \ + /* 474 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 498 - RxErrInvalidSrcAddrCount, */ \ + /* 478 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 502 - RxErrSecCount, */ \ + /* 482 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 506 - RxErrFcsCount, */ \ + /* 486 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 510 - RxErrOtherCount, */ \ + /* 490 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 514 - ActiveTimestamp, */ \ + /* 494 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 522 - PendingTimestamp, */ \ + /* 502 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 530 - delay, */ \ + /* 510 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 534 - ChannelMask, */ \ + /* 514 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 541 - FeatureMap, */ \ + /* 521 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0F, \ \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server), big-endian */ \ \ - /* 545 - LifetimeRunningHours, */ \ + /* 525 - LifetimeRunningHours, */ \ 0x00, 0x00, 0x00, \ \ - /* 548 - Power, */ \ + /* 528 - Power, */ \ 0x00, 0x00, 0x00, \ \ - /* 551 - LifetimeEnergyConsumed, */ \ + /* 531 - LifetimeEnergyConsumed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 555 - FeatureMap, */ \ + /* 535 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } @@ -259,7 +259,7 @@ /* 10 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 38 - BasicCommissioningInfoList, */ \ + /* 18 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -275,191 +275,191 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 292 - FeatureMap, */ \ + /* 272 - FeatureMap, */ \ 0x06, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), little-endian */ \ \ - /* 296 - Networks, */ \ + /* 276 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 308 - LastConnectErrorValue, */ \ + /* 288 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 312 - FeatureMap, */ \ + /* 292 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), little-endian */ \ \ - /* 316 - UpTime, */ \ + /* 296 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 324 - TotalOperationalHours, */ \ + /* 304 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), little-endian */ \ \ - /* 328 - CurrentHeapFree, */ \ + /* 308 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 336 - CurrentHeapUsed, */ \ + /* 316 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 344 - CurrentHeapHighWatermark, */ \ + /* 324 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 352 - FeatureMap, */ \ + /* 332 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), little-endian */ \ \ - /* 356 - NetworkName, */ \ + /* 336 - NetworkName, */ \ 0x00, 0x00, \ \ - /* 358 - ExtendedPanId, */ \ + /* 338 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 366 - OverrunCount, */ \ + /* 346 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 374 - PartitionId, */ \ + /* 354 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 378 - TxTotalCount, */ \ + /* 358 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 382 - TxUnicastCount, */ \ + /* 362 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 386 - TxBroadcastCount, */ \ + /* 366 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 390 - TxAckRequestedCount, */ \ + /* 370 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 394 - TxAckedCount, */ \ + /* 374 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 398 - TxNoAckRequestedCount, */ \ + /* 378 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 402 - TxDataCount, */ \ + /* 382 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 406 - TxDataPollCount, */ \ + /* 386 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 410 - TxBeaconCount, */ \ + /* 390 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 414 - TxBeaconRequestCount, */ \ + /* 394 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 418 - TxOtherCount, */ \ + /* 398 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 422 - TxRetryCount, */ \ + /* 402 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 426 - TxDirectMaxRetryExpiryCount, */ \ + /* 406 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 430 - TxIndirectMaxRetryExpiryCount, */ \ + /* 410 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 434 - TxErrCcaCount, */ \ + /* 414 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 438 - TxErrAbortCount, */ \ + /* 418 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 442 - TxErrBusyChannelCount, */ \ + /* 422 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 446 - RxTotalCount, */ \ + /* 426 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 450 - RxUnicastCount, */ \ + /* 430 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 454 - RxBroadcastCount, */ \ + /* 434 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 458 - RxDataCount, */ \ + /* 438 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 462 - RxDataPollCount, */ \ + /* 442 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 466 - RxBeaconCount, */ \ + /* 446 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 470 - RxBeaconRequestCount, */ \ + /* 450 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 474 - RxOtherCount, */ \ + /* 454 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 478 - RxAddressFilteredCount, */ \ + /* 458 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 482 - RxDestAddrFilteredCount, */ \ + /* 462 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 486 - RxDuplicatedCount, */ \ + /* 466 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 490 - RxErrNoFrameCount, */ \ + /* 470 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 494 - RxErrUnknownNeighborCount, */ \ + /* 474 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 498 - RxErrInvalidSrcAddrCount, */ \ + /* 478 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 502 - RxErrSecCount, */ \ + /* 482 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 506 - RxErrFcsCount, */ \ + /* 486 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 510 - RxErrOtherCount, */ \ + /* 490 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 514 - ActiveTimestamp, */ \ + /* 494 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 522 - PendingTimestamp, */ \ + /* 502 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 530 - delay, */ \ + /* 510 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 534 - ChannelMask, */ \ + /* 514 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 541 - FeatureMap, */ \ + /* 521 - FeatureMap, */ \ 0x0F, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server), little-endian */ \ \ - /* 545 - LifetimeRunningHours, */ \ + /* 525 - LifetimeRunningHours, */ \ 0x00, 0x00, 0x00, \ \ - /* 548 - Power, */ \ + /* 528 - Power, */ \ 0x00, 0x00, 0x00, \ \ - /* 551 - LifetimeEnergyConsumed, */ \ + /* 531 - LifetimeEnergyConsumed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 555 - FeatureMap, */ \ + /* 535 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (63) +#define GENERATED_DEFAULTS_COUNT (61) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -501,12 +501,11 @@ { \ \ /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Access Control (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -581,30 +580,30 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x00000000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(30) }, /* Breadcrumb */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(38) }, /* BasicCommissioningInfoList */ \ + { 0x00000000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(10) }, /* Breadcrumb */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(18) }, /* BasicCommissioningInfoList */ \ { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* RegulatoryConfig */ \ { 0x00000003, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* LocationCapability */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(292) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(272) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* MaxNetworks */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(296) }, /* Networks */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(276) }, /* Networks */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ScanMaxTimeSeconds */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ConnectMaxTimeSeconds */ \ { 0x00000004, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* InterfaceEnabled */ \ { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkingStatus */ \ { 0x00000006, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkID */ \ - { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(308) }, /* LastConnectErrorValue */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(312) }, /* FeatureMap */ \ + { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(288) }, /* LastConnectErrorValue */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(292) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NetworkInterfaces */ \ { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* RebootCount */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(316) }, /* UpTime */ \ - { 0x00000003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(324) }, /* TotalOperationalHours */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(296) }, /* UpTime */ \ + { 0x00000003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(304) }, /* TotalOperationalHours */ \ { 0x00000004, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BootReasons */ \ { 0x00000005, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* ActiveHardwareFaults */ \ @@ -615,23 +614,23 @@ \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ThreadMetrics */ \ - { 0x00000001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(328) }, /* CurrentHeapFree */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(336) }, /* CurrentHeapUsed */ \ - { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(344) }, /* CurrentHeapHighWatermark */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(352) }, /* FeatureMap */ \ + { 0x00000001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(308) }, /* CurrentHeapFree */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(316) }, /* CurrentHeapUsed */ \ + { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(324) }, /* CurrentHeapHighWatermark */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(332) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x00000001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ - { 0x00000002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(356) }, /* NetworkName */ \ + { 0x00000002, ZAP_TYPE(CHAR_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(336) }, /* NetworkName */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ - { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(358) }, /* ExtendedPanId */ \ + { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(338) }, /* ExtendedPanId */ \ { 0x00000005, ZAP_TYPE(OCTET_STRING), 18, 0, ZAP_EMPTY_DEFAULT() }, /* MeshLocalPrefix */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(366) }, /* OverrunCount */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(346) }, /* OverrunCount */ \ { 0x00000007, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NeighborTableList */ \ { 0x00000008, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* RouteTableList */ \ - { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(374) }, /* PartitionId */ \ + { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(354) }, /* PartitionId */ \ { 0x0000000A, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* weighting */ \ { 0x0000000B, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* DataVersion */ \ { 0x0000000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* StableDataVersion */ \ @@ -644,58 +643,58 @@ { 0x00000013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PartitionIdChangeCount */ \ { 0x00000014, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* BetterPartitionAttachAttemptCount */ \ { 0x00000015, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ParentChangeCount */ \ - { 0x00000016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(378) }, /* TxTotalCount */ \ - { 0x00000017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(382) }, /* TxUnicastCount */ \ - { 0x00000018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(386) }, /* TxBroadcastCount */ \ - { 0x00000019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(390) }, /* TxAckRequestedCount */ \ - { 0x0000001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(394) }, /* TxAckedCount */ \ - { 0x0000001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(398) }, /* TxNoAckRequestedCount */ \ - { 0x0000001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(402) }, /* TxDataCount */ \ - { 0x0000001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(406) }, /* TxDataPollCount */ \ - { 0x0000001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(410) }, /* TxBeaconCount */ \ - { 0x0000001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(414) }, /* TxBeaconRequestCount */ \ - { 0x00000020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(418) }, /* TxOtherCount */ \ - { 0x00000021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(422) }, /* TxRetryCount */ \ - { 0x00000022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(426) }, /* TxDirectMaxRetryExpiryCount */ \ - { 0x00000023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(430) }, /* TxIndirectMaxRetryExpiryCount */ \ - { 0x00000024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(434) }, /* TxErrCcaCount */ \ - { 0x00000025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(438) }, /* TxErrAbortCount */ \ - { 0x00000026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(442) }, /* TxErrBusyChannelCount */ \ - { 0x00000027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(446) }, /* RxTotalCount */ \ - { 0x00000028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(450) }, /* RxUnicastCount */ \ - { 0x00000029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(454) }, /* RxBroadcastCount */ \ - { 0x0000002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(458) }, /* RxDataCount */ \ - { 0x0000002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(462) }, /* RxDataPollCount */ \ - { 0x0000002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(466) }, /* RxBeaconCount */ \ - { 0x0000002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(470) }, /* RxBeaconRequestCount */ \ - { 0x0000002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(474) }, /* RxOtherCount */ \ - { 0x0000002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(478) }, /* RxAddressFilteredCount */ \ - { 0x00000030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(482) }, /* RxDestAddrFilteredCount */ \ - { 0x00000031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(486) }, /* RxDuplicatedCount */ \ - { 0x00000032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(490) }, /* RxErrNoFrameCount */ \ - { 0x00000033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(494) }, /* RxErrUnknownNeighborCount */ \ - { 0x00000034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(498) }, /* RxErrInvalidSrcAddrCount */ \ - { 0x00000035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(502) }, /* RxErrSecCount */ \ - { 0x00000036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(506) }, /* RxErrFcsCount */ \ - { 0x00000037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(510) }, /* RxErrOtherCount */ \ - { 0x00000038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(514) }, /* ActiveTimestamp */ \ - { 0x00000039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(522) }, /* PendingTimestamp */ \ - { 0x0000003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(530) }, /* delay */ \ + { 0x00000016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(358) }, /* TxTotalCount */ \ + { 0x00000017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(362) }, /* TxUnicastCount */ \ + { 0x00000018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(366) }, /* TxBroadcastCount */ \ + { 0x00000019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(370) }, /* TxAckRequestedCount */ \ + { 0x0000001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(374) }, /* TxAckedCount */ \ + { 0x0000001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(378) }, /* TxNoAckRequestedCount */ \ + { 0x0000001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(382) }, /* TxDataCount */ \ + { 0x0000001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(386) }, /* TxDataPollCount */ \ + { 0x0000001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(390) }, /* TxBeaconCount */ \ + { 0x0000001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(394) }, /* TxBeaconRequestCount */ \ + { 0x00000020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(398) }, /* TxOtherCount */ \ + { 0x00000021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(402) }, /* TxRetryCount */ \ + { 0x00000022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(406) }, /* TxDirectMaxRetryExpiryCount */ \ + { 0x00000023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(410) }, /* TxIndirectMaxRetryExpiryCount */ \ + { 0x00000024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(414) }, /* TxErrCcaCount */ \ + { 0x00000025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(418) }, /* TxErrAbortCount */ \ + { 0x00000026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(422) }, /* TxErrBusyChannelCount */ \ + { 0x00000027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(426) }, /* RxTotalCount */ \ + { 0x00000028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(430) }, /* RxUnicastCount */ \ + { 0x00000029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(434) }, /* RxBroadcastCount */ \ + { 0x0000002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(438) }, /* RxDataCount */ \ + { 0x0000002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(442) }, /* RxDataPollCount */ \ + { 0x0000002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(446) }, /* RxBeaconCount */ \ + { 0x0000002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(450) }, /* RxBeaconRequestCount */ \ + { 0x0000002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(454) }, /* RxOtherCount */ \ + { 0x0000002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(458) }, /* RxAddressFilteredCount */ \ + { 0x00000030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(462) }, /* RxDestAddrFilteredCount */ \ + { 0x00000031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(466) }, /* RxDuplicatedCount */ \ + { 0x00000032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(470) }, /* RxErrNoFrameCount */ \ + { 0x00000033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(474) }, /* RxErrUnknownNeighborCount */ \ + { 0x00000034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(478) }, /* RxErrInvalidSrcAddrCount */ \ + { 0x00000035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(482) }, /* RxErrSecCount */ \ + { 0x00000036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(486) }, /* RxErrFcsCount */ \ + { 0x00000037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(490) }, /* RxErrOtherCount */ \ + { 0x00000038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(494) }, /* ActiveTimestamp */ \ + { 0x00000039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(502) }, /* PendingTimestamp */ \ + { 0x0000003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(510) }, /* delay */ \ { 0x0000003B, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SecurityPolicy */ \ - { 0x0000003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(534) }, /* ChannelMask */ \ + { 0x0000003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(514) }, /* ChannelMask */ \ { 0x0000003D, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* OperationalDatasetComponents */ \ { 0x0000003E, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* ActiveNetworkFaultsList */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(541) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(521) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { 0x00000000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* WindowStatus */ \ + { 0x00000000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ { 0x00000001, ZAP_TYPE(FABRIC_IDX), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* AdminVendorId */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ @@ -726,12 +725,11 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ { 0x00000000, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MaxPressure */ \ @@ -753,16 +751,16 @@ { 0x00000013, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Capacity */ \ { 0x00000014, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Speed */ \ { 0x00000015, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(545) }, /* LifetimeRunningHours */ \ - { 0x00000016, ZAP_TYPE(INT24U), 3, 0, ZAP_LONG_DEFAULTS_INDEX(548) }, /* Power */ \ + ZAP_LONG_DEFAULTS_INDEX(525) }, /* LifetimeRunningHours */ \ + { 0x00000016, ZAP_TYPE(INT24U), 3, 0, ZAP_LONG_DEFAULTS_INDEX(528) }, /* Power */ \ { 0x00000017, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(551) }, /* LifetimeEnergyConsumed */ \ + ZAP_LONG_DEFAULTS_INDEX(531) }, /* LifetimeEnergyConsumed */ \ { 0x00000020, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(1) }, /* OperationMode */ \ { 0x00000021, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(2) }, /* ControlMode */ \ { 0x00000022, ZAP_TYPE(BITMAP16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* AlarmMask */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(555) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(535) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ @@ -893,107 +891,287 @@ #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask #define GENERATED_CLUSTER_COUNT 25 -#define GENERATED_CLUSTERS \ - { \ - { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(0), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { 0x00000028, \ - ZAP_ATTRIBUTE_INDEX(5), \ - 20, \ - 39, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayBasicServer }, /* Endpoint: 0, Cluster: Basic (server) */ \ - { 0x0000002B, \ - ZAP_ATTRIBUTE_INDEX(25), \ - 3, \ - 38, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayLocalizationConfigurationServer }, /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ - { 0x0000002C, \ - ZAP_ATTRIBUTE_INDEX(28), \ - 4, \ - 4, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayTimeFormatLocalizationServer }, /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ - { 0x0000002D, \ - ZAP_ATTRIBUTE_INDEX(32), \ - 3, \ - 7, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayUnitLocalizationServer }, /* Endpoint: 0, Cluster: Unit Localization (server) */ \ - { \ - 0x00000030, ZAP_ATTRIBUTE_INDEX(32), 6, 270, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { \ - 0x00000031, ZAP_ATTRIBUTE_INDEX(38), 10, 60, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { \ - 0x00000032, ZAP_ATTRIBUTE_INDEX(51), 0, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ - { \ - 0x00000033, ZAP_ATTRIBUTE_INDEX(51), 9, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ - { \ - 0x00000034, ZAP_ATTRIBUTE_INDEX(60), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { \ - 0x00000035, ZAP_ATTRIBUTE_INDEX(66), 65, 247, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { \ - 0x0000003C, ZAP_ATTRIBUTE_INDEX(131), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(135), 7, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(142), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ - { \ - 0x00000041, ZAP_ATTRIBUTE_INDEX(144), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: User Label (server) */ \ - { 0x00000006, \ - ZAP_ATTRIBUTE_INDEX(146), \ - 2, \ - 3, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ - { 0x00000008, \ - ZAP_ATTRIBUTE_INDEX(148), \ - 2, \ - 3, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ - { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(150), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ - { \ - 0x00000200, \ - ZAP_ATTRIBUTE_INDEX(155), \ - 26, \ - 54, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayPumpConfigurationAndControlServer \ - }, /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ - { \ - 0x00000402, ZAP_ATTRIBUTE_INDEX(181), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 1, Cluster: Temperature Measurement (client) */ \ - { \ - 0x00000402, ZAP_ATTRIBUTE_INDEX(182), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ - { \ - 0x00000403, ZAP_ATTRIBUTE_INDEX(186), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 1, Cluster: Pressure Measurement (client) */ \ - { \ - 0x00000403, ZAP_ATTRIBUTE_INDEX(187), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ - { \ - 0x00000404, ZAP_ATTRIBUTE_INDEX(191), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 1, Cluster: Flow Measurement (client) */ \ - { \ - 0x00000404, ZAP_ATTRIBUTE_INDEX(192), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ - } + +// clang-format off +#define GENERATED_CLUSTERS { \ + { \ + /* Endpoint: 0, Cluster: Descriptor (server) */ \ + .clusterId = 0x0000001D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(0), \ + .attributeCount = 5, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Basic (server) */ \ + .clusterId = 0x00000028, \ + .attributes = ZAP_ATTRIBUTE_INDEX(5), \ + .attributeCount = 20, \ + .clusterSize = 39, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayBasicServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ + .clusterId = 0x0000002B, \ + .attributes = ZAP_ATTRIBUTE_INDEX(25), \ + .attributeCount = 3, \ + .clusterSize = 38, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayLocalizationConfigurationServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ + .clusterId = 0x0000002C, \ + .attributes = ZAP_ATTRIBUTE_INDEX(28), \ + .attributeCount = 4, \ + .clusterSize = 4, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayTimeFormatLocalizationServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Unit Localization (server) */ \ + .clusterId = 0x0000002D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(32), \ + .attributeCount = 3, \ + .clusterSize = 7, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: General Commissioning (server) */ \ + .clusterId = 0x00000030, \ + .attributes = ZAP_ATTRIBUTE_INDEX(35), \ + .attributeCount = 6, \ + .clusterSize = 270, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 0 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 4 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ + .clusterId = 0x00000031, \ + .attributes = ZAP_ATTRIBUTE_INDEX(41), \ + .attributeCount = 10, \ + .clusterSize = 60, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 7 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 14 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ + .clusterId = 0x00000032, \ + .attributes = ZAP_ATTRIBUTE_INDEX(51), \ + .attributeCount = 0, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 17 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ + .clusterId = 0x00000033, \ + .attributes = ZAP_ATTRIBUTE_INDEX(51), \ + .attributeCount = 9, \ + .clusterSize = 17, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ + .clusterId = 0x00000034, \ + .attributes = ZAP_ATTRIBUTE_INDEX(60), \ + .attributeCount = 6, \ + .clusterSize = 30, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 19 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ + .clusterId = 0x00000035, \ + .attributes = ZAP_ATTRIBUTE_INDEX(66), \ + .attributeCount = 65, \ + .clusterSize = 247, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ + .clusterId = 0x0000003C, \ + .attributes = ZAP_ATTRIBUTE_INDEX(131), \ + .attributeCount = 4, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 21 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ + .clusterId = 0x0000003E, \ + .attributes = ZAP_ATTRIBUTE_INDEX(135), \ + .attributeCount = 7, \ + .clusterSize = 4, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 25 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 35 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Fixed Label (server) */ \ + .clusterId = 0x00000040, \ + .attributes = ZAP_ATTRIBUTE_INDEX(142), \ + .attributeCount = 2, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: User Label (server) */ \ + .clusterId = 0x00000041, \ + .attributes = ZAP_ATTRIBUTE_INDEX(144), \ + .attributeCount = 2, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: On/Off (server) */ \ + .clusterId = 0x00000006, \ + .attributes = ZAP_ATTRIBUTE_INDEX(146), \ + .attributeCount = 2, \ + .clusterSize = 3, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayOnOffServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 40 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Level Control (server) */ \ + .clusterId = 0x00000008, \ + .attributes = ZAP_ATTRIBUTE_INDEX(148), \ + .attributeCount = 2, \ + .clusterSize = 3, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayLevelControlServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 44 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Descriptor (server) */ \ + .clusterId = 0x0000001D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(150), \ + .attributeCount = 5, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ + .clusterId = 0x00000200, \ + .attributes = ZAP_ATTRIBUTE_INDEX(155), \ + .attributeCount = 26, \ + .clusterSize = 54, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayPumpConfigurationAndControlServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Temperature Measurement (client) */ \ + .clusterId = 0x00000402, \ + .attributes = ZAP_ATTRIBUTE_INDEX(181), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ + .clusterId = 0x00000402, \ + .attributes = ZAP_ATTRIBUTE_INDEX(182), \ + .attributeCount = 4, \ + .clusterSize = 8, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Pressure Measurement (client) */ \ + .clusterId = 0x00000403, \ + .attributes = ZAP_ATTRIBUTE_INDEX(186), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ + .clusterId = 0x00000403, \ + .attributes = ZAP_ATTRIBUTE_INDEX(187), \ + .attributeCount = 4, \ + .clusterSize = 8, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Flow Measurement (client) */ \ + .clusterId = 0x00000404, \ + .attributes = ZAP_ATTRIBUTE_INDEX(191), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ + .clusterId = 0x00000404, \ + .attributes = ZAP_ATTRIBUTE_INDEX(192), \ + .attributeCount = 4, \ + .clusterSize = 8, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ +} + +// clang-format on #define ZAP_CLUSTER_INDEX(index) (&generatedClusters[index]) @@ -1002,7 +1180,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 14, 1363 }, { ZAP_CLUSTER_INDEX(14), 10, 90 }, \ + { ZAP_CLUSTER_INDEX(0), 15, 722 }, { ZAP_CLUSTER_INDEX(15), 10, 90 }, \ } // Largest attribute size is needed for various buffers @@ -1012,7 +1190,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (39) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (1453) +#define ATTRIBUTE_MAX_SIZE (812) // 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 2ff4961ce6e585..9b7f088256c0d0 100644 --- a/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h +++ b/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h @@ -58,239 +58,223 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 38 - BasicCommissioningInfoList, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 292 - FeatureMap, */ \ + /* 272 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x06, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), big-endian */ \ \ - /* 296 - Networks, */ \ + /* 276 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 308 - LastConnectErrorValue, */ \ + /* 288 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 312 - FeatureMap, */ \ + /* 292 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), big-endian */ \ \ - /* 316 - UpTime, */ \ + /* 296 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 324 - TotalOperationalHours, */ \ + /* 304 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), big-endian */ \ \ - /* 328 - CurrentHeapFree, */ \ + /* 308 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 336 - CurrentHeapUsed, */ \ + /* 316 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 344 - CurrentHeapHighWatermark, */ \ + /* 324 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 352 - FeatureMap, */ \ + /* 332 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), big-endian */ \ \ - /* 356 - NetworkName, */ \ + /* 336 - NetworkName, */ \ 0x00, 0x00, \ \ - /* 358 - ExtendedPanId, */ \ + /* 338 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 366 - OverrunCount, */ \ + /* 346 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 374 - PartitionId, */ \ + /* 354 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 378 - TxTotalCount, */ \ + /* 358 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 382 - TxUnicastCount, */ \ + /* 362 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 386 - TxBroadcastCount, */ \ + /* 366 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 390 - TxAckRequestedCount, */ \ + /* 370 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 394 - TxAckedCount, */ \ + /* 374 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 398 - TxNoAckRequestedCount, */ \ + /* 378 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 402 - TxDataCount, */ \ + /* 382 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 406 - TxDataPollCount, */ \ + /* 386 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 410 - TxBeaconCount, */ \ + /* 390 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 414 - TxBeaconRequestCount, */ \ + /* 394 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 418 - TxOtherCount, */ \ + /* 398 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 422 - TxRetryCount, */ \ + /* 402 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 426 - TxDirectMaxRetryExpiryCount, */ \ + /* 406 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 430 - TxIndirectMaxRetryExpiryCount, */ \ + /* 410 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 434 - TxErrCcaCount, */ \ + /* 414 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 438 - TxErrAbortCount, */ \ + /* 418 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 442 - TxErrBusyChannelCount, */ \ + /* 422 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 446 - RxTotalCount, */ \ + /* 426 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 450 - RxUnicastCount, */ \ + /* 430 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 454 - RxBroadcastCount, */ \ + /* 434 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 458 - RxDataCount, */ \ + /* 438 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 462 - RxDataPollCount, */ \ + /* 442 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 466 - RxBeaconCount, */ \ + /* 446 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 470 - RxBeaconRequestCount, */ \ + /* 450 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 474 - RxOtherCount, */ \ + /* 454 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 478 - RxAddressFilteredCount, */ \ + /* 458 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 482 - RxDestAddrFilteredCount, */ \ + /* 462 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 486 - RxDuplicatedCount, */ \ + /* 466 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 490 - RxErrNoFrameCount, */ \ + /* 470 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 494 - RxErrUnknownNeighborCount, */ \ + /* 474 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 498 - RxErrInvalidSrcAddrCount, */ \ + /* 478 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 502 - RxErrSecCount, */ \ + /* 482 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 506 - RxErrFcsCount, */ \ + /* 486 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 510 - RxErrOtherCount, */ \ + /* 490 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 514 - ActiveTimestamp, */ \ + /* 494 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 522 - PendingTimestamp, */ \ + /* 502 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 530 - delay, */ \ + /* 510 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 534 - ChannelMask, */ \ + /* 514 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 541 - FeatureMap, */ \ + /* 521 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0F, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), big-endian */ \ \ - /* 545 - BeaconLostCount, */ \ + /* 525 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 549 - BeaconRxCount, */ \ + /* 529 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 553 - PacketMulticastRxCount, */ \ + /* 533 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 557 - PacketMulticastTxCount, */ \ + /* 537 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 561 - PacketUnicastRxCount, */ \ + /* 541 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 565 - PacketUnicastTxCount, */ \ + /* 545 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 569 - CurrentMaxRate, */ \ + /* 549 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 577 - OverrunCount, */ \ + /* 557 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 585 - FeatureMap, */ \ + /* 565 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), big-endian */ \ \ - /* 589 - PacketRxCount, */ \ + /* 569 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 597 - PacketTxCount, */ \ + /* 577 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 605 - TxErrCount, */ \ + /* 585 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 613 - CollisionCount, */ \ + /* 593 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 621 - OverrunCount, */ \ + /* 601 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 629 - TimeSinceReset, */ \ + /* 609 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 637 - FeatureMap, */ \ + /* 617 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ } @@ -329,245 +313,229 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 38 - BasicCommissioningInfoList, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 292 - FeatureMap, */ \ + /* 272 - FeatureMap, */ \ 0x06, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), little-endian */ \ \ - /* 296 - Networks, */ \ + /* 276 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 308 - LastConnectErrorValue, */ \ + /* 288 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 312 - FeatureMap, */ \ + /* 292 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), little-endian */ \ \ - /* 316 - UpTime, */ \ + /* 296 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 324 - TotalOperationalHours, */ \ + /* 304 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), little-endian */ \ \ - /* 328 - CurrentHeapFree, */ \ + /* 308 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 336 - CurrentHeapUsed, */ \ + /* 316 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 344 - CurrentHeapHighWatermark, */ \ + /* 324 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 352 - FeatureMap, */ \ + /* 332 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), little-endian */ \ \ - /* 356 - NetworkName, */ \ + /* 336 - NetworkName, */ \ 0x00, 0x00, \ \ - /* 358 - ExtendedPanId, */ \ + /* 338 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 366 - OverrunCount, */ \ + /* 346 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 374 - PartitionId, */ \ + /* 354 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 378 - TxTotalCount, */ \ + /* 358 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 382 - TxUnicastCount, */ \ + /* 362 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 386 - TxBroadcastCount, */ \ + /* 366 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 390 - TxAckRequestedCount, */ \ + /* 370 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 394 - TxAckedCount, */ \ + /* 374 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 398 - TxNoAckRequestedCount, */ \ + /* 378 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 402 - TxDataCount, */ \ + /* 382 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 406 - TxDataPollCount, */ \ + /* 386 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 410 - TxBeaconCount, */ \ + /* 390 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 414 - TxBeaconRequestCount, */ \ + /* 394 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 418 - TxOtherCount, */ \ + /* 398 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 422 - TxRetryCount, */ \ + /* 402 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 426 - TxDirectMaxRetryExpiryCount, */ \ + /* 406 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 430 - TxIndirectMaxRetryExpiryCount, */ \ + /* 410 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 434 - TxErrCcaCount, */ \ + /* 414 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 438 - TxErrAbortCount, */ \ + /* 418 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 442 - TxErrBusyChannelCount, */ \ + /* 422 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 446 - RxTotalCount, */ \ + /* 426 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 450 - RxUnicastCount, */ \ + /* 430 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 454 - RxBroadcastCount, */ \ + /* 434 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 458 - RxDataCount, */ \ + /* 438 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 462 - RxDataPollCount, */ \ + /* 442 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 466 - RxBeaconCount, */ \ + /* 446 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 470 - RxBeaconRequestCount, */ \ + /* 450 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 474 - RxOtherCount, */ \ + /* 454 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 478 - RxAddressFilteredCount, */ \ + /* 458 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 482 - RxDestAddrFilteredCount, */ \ + /* 462 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 486 - RxDuplicatedCount, */ \ + /* 466 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 490 - RxErrNoFrameCount, */ \ + /* 470 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 494 - RxErrUnknownNeighborCount, */ \ + /* 474 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 498 - RxErrInvalidSrcAddrCount, */ \ + /* 478 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 502 - RxErrSecCount, */ \ + /* 482 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 506 - RxErrFcsCount, */ \ + /* 486 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 510 - RxErrOtherCount, */ \ + /* 490 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 514 - ActiveTimestamp, */ \ + /* 494 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 522 - PendingTimestamp, */ \ + /* 502 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 530 - delay, */ \ + /* 510 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 534 - ChannelMask, */ \ + /* 514 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 541 - FeatureMap, */ \ + /* 521 - FeatureMap, */ \ 0x0F, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), little-endian */ \ \ - /* 545 - BeaconLostCount, */ \ + /* 525 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 549 - BeaconRxCount, */ \ + /* 529 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 553 - PacketMulticastRxCount, */ \ + /* 533 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 557 - PacketMulticastTxCount, */ \ + /* 537 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 561 - PacketUnicastRxCount, */ \ + /* 541 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 565 - PacketUnicastTxCount, */ \ + /* 545 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 569 - CurrentMaxRate, */ \ + /* 549 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 577 - OverrunCount, */ \ + /* 557 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 585 - FeatureMap, */ \ + /* 565 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), little-endian */ \ \ - /* 589 - PacketRxCount, */ \ + /* 569 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 597 - PacketTxCount, */ \ + /* 577 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 605 - TxErrCount, */ \ + /* 585 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 613 - CollisionCount, */ \ + /* 593 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 621 - OverrunCount, */ \ + /* 601 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 629 - TimeSinceReset, */ \ + /* 609 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 637 - FeatureMap, */ \ + /* 617 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ } #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (75) +#define GENERATED_DEFAULTS_COUNT (73) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -608,12 +576,11 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Access Control (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -688,30 +655,30 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x00000000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(30) }, /* Breadcrumb */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(38) }, /* BasicCommissioningInfoList */ \ + { 0x00000000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(10) }, /* Breadcrumb */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(18) }, /* BasicCommissioningInfoList */ \ { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* RegulatoryConfig */ \ { 0x00000003, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* LocationCapability */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(292) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(272) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* MaxNetworks */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(296) }, /* Networks */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(276) }, /* Networks */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ScanMaxTimeSeconds */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ConnectMaxTimeSeconds */ \ { 0x00000004, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* InterfaceEnabled */ \ { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkingStatus */ \ { 0x00000006, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkID */ \ - { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(308) }, /* LastConnectErrorValue */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(312) }, /* FeatureMap */ \ + { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(288) }, /* LastConnectErrorValue */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(292) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NetworkInterfaces */ \ { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* RebootCount */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(316) }, /* UpTime */ \ - { 0x00000003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(324) }, /* TotalOperationalHours */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(296) }, /* UpTime */ \ + { 0x00000003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(304) }, /* TotalOperationalHours */ \ { 0x00000004, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BootReasons */ \ { 0x00000005, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* ActiveHardwareFaults */ \ @@ -722,23 +689,23 @@ \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ThreadMetrics */ \ - { 0x00000001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(328) }, /* CurrentHeapFree */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(336) }, /* CurrentHeapUsed */ \ - { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(344) }, /* CurrentHeapHighWatermark */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(352) }, /* FeatureMap */ \ + { 0x00000001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(308) }, /* CurrentHeapFree */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(316) }, /* CurrentHeapUsed */ \ + { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(324) }, /* CurrentHeapHighWatermark */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(332) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x00000001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ - { 0x00000002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(356) }, /* NetworkName */ \ + { 0x00000002, ZAP_TYPE(CHAR_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(336) }, /* NetworkName */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ - { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(358) }, /* ExtendedPanId */ \ + { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(338) }, /* ExtendedPanId */ \ { 0x00000005, ZAP_TYPE(OCTET_STRING), 18, 0, ZAP_EMPTY_DEFAULT() }, /* MeshLocalPrefix */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(366) }, /* OverrunCount */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(346) }, /* OverrunCount */ \ { 0x00000007, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NeighborTableList */ \ { 0x00000008, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* RouteTableList */ \ - { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(374) }, /* PartitionId */ \ + { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(354) }, /* PartitionId */ \ { 0x0000000A, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* weighting */ \ { 0x0000000B, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* DataVersion */ \ { 0x0000000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* StableDataVersion */ \ @@ -751,50 +718,50 @@ { 0x00000013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PartitionIdChangeCount */ \ { 0x00000014, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* BetterPartitionAttachAttemptCount */ \ { 0x00000015, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ParentChangeCount */ \ - { 0x00000016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(378) }, /* TxTotalCount */ \ - { 0x00000017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(382) }, /* TxUnicastCount */ \ - { 0x00000018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(386) }, /* TxBroadcastCount */ \ - { 0x00000019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(390) }, /* TxAckRequestedCount */ \ - { 0x0000001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(394) }, /* TxAckedCount */ \ - { 0x0000001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(398) }, /* TxNoAckRequestedCount */ \ - { 0x0000001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(402) }, /* TxDataCount */ \ - { 0x0000001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(406) }, /* TxDataPollCount */ \ - { 0x0000001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(410) }, /* TxBeaconCount */ \ - { 0x0000001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(414) }, /* TxBeaconRequestCount */ \ - { 0x00000020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(418) }, /* TxOtherCount */ \ - { 0x00000021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(422) }, /* TxRetryCount */ \ - { 0x00000022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(426) }, /* TxDirectMaxRetryExpiryCount */ \ - { 0x00000023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(430) }, /* TxIndirectMaxRetryExpiryCount */ \ - { 0x00000024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(434) }, /* TxErrCcaCount */ \ - { 0x00000025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(438) }, /* TxErrAbortCount */ \ - { 0x00000026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(442) }, /* TxErrBusyChannelCount */ \ - { 0x00000027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(446) }, /* RxTotalCount */ \ - { 0x00000028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(450) }, /* RxUnicastCount */ \ - { 0x00000029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(454) }, /* RxBroadcastCount */ \ - { 0x0000002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(458) }, /* RxDataCount */ \ - { 0x0000002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(462) }, /* RxDataPollCount */ \ - { 0x0000002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(466) }, /* RxBeaconCount */ \ - { 0x0000002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(470) }, /* RxBeaconRequestCount */ \ - { 0x0000002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(474) }, /* RxOtherCount */ \ - { 0x0000002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(478) }, /* RxAddressFilteredCount */ \ - { 0x00000030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(482) }, /* RxDestAddrFilteredCount */ \ - { 0x00000031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(486) }, /* RxDuplicatedCount */ \ - { 0x00000032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(490) }, /* RxErrNoFrameCount */ \ - { 0x00000033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(494) }, /* RxErrUnknownNeighborCount */ \ - { 0x00000034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(498) }, /* RxErrInvalidSrcAddrCount */ \ - { 0x00000035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(502) }, /* RxErrSecCount */ \ - { 0x00000036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(506) }, /* RxErrFcsCount */ \ - { 0x00000037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(510) }, /* RxErrOtherCount */ \ - { 0x00000038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(514) }, /* ActiveTimestamp */ \ - { 0x00000039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(522) }, /* PendingTimestamp */ \ - { 0x0000003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(530) }, /* delay */ \ + { 0x00000016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(358) }, /* TxTotalCount */ \ + { 0x00000017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(362) }, /* TxUnicastCount */ \ + { 0x00000018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(366) }, /* TxBroadcastCount */ \ + { 0x00000019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(370) }, /* TxAckRequestedCount */ \ + { 0x0000001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(374) }, /* TxAckedCount */ \ + { 0x0000001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(378) }, /* TxNoAckRequestedCount */ \ + { 0x0000001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(382) }, /* TxDataCount */ \ + { 0x0000001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(386) }, /* TxDataPollCount */ \ + { 0x0000001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(390) }, /* TxBeaconCount */ \ + { 0x0000001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(394) }, /* TxBeaconRequestCount */ \ + { 0x00000020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(398) }, /* TxOtherCount */ \ + { 0x00000021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(402) }, /* TxRetryCount */ \ + { 0x00000022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(406) }, /* TxDirectMaxRetryExpiryCount */ \ + { 0x00000023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(410) }, /* TxIndirectMaxRetryExpiryCount */ \ + { 0x00000024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(414) }, /* TxErrCcaCount */ \ + { 0x00000025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(418) }, /* TxErrAbortCount */ \ + { 0x00000026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(422) }, /* TxErrBusyChannelCount */ \ + { 0x00000027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(426) }, /* RxTotalCount */ \ + { 0x00000028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(430) }, /* RxUnicastCount */ \ + { 0x00000029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(434) }, /* RxBroadcastCount */ \ + { 0x0000002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(438) }, /* RxDataCount */ \ + { 0x0000002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(442) }, /* RxDataPollCount */ \ + { 0x0000002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(446) }, /* RxBeaconCount */ \ + { 0x0000002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(450) }, /* RxBeaconRequestCount */ \ + { 0x0000002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(454) }, /* RxOtherCount */ \ + { 0x0000002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(458) }, /* RxAddressFilteredCount */ \ + { 0x00000030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(462) }, /* RxDestAddrFilteredCount */ \ + { 0x00000031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(466) }, /* RxDuplicatedCount */ \ + { 0x00000032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(470) }, /* RxErrNoFrameCount */ \ + { 0x00000033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(474) }, /* RxErrUnknownNeighborCount */ \ + { 0x00000034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(478) }, /* RxErrInvalidSrcAddrCount */ \ + { 0x00000035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(482) }, /* RxErrSecCount */ \ + { 0x00000036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(486) }, /* RxErrFcsCount */ \ + { 0x00000037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(490) }, /* RxErrOtherCount */ \ + { 0x00000038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(494) }, /* ActiveTimestamp */ \ + { 0x00000039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(502) }, /* PendingTimestamp */ \ + { 0x0000003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(510) }, /* delay */ \ { 0x0000003B, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SecurityPolicy */ \ - { 0x0000003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(534) }, /* ChannelMask */ \ + { 0x0000003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(514) }, /* ChannelMask */ \ { 0x0000003D, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* OperationalDatasetComponents */ \ { 0x0000003E, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* ActiveNetworkFaultsList */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(541) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(521) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ @@ -803,36 +770,36 @@ { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* WiFiVersion */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChannelNumber */ \ { 0x00000004, ZAP_TYPE(INT8S), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Rssi */ \ - { 0x00000005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(545) }, /* BeaconLostCount */ \ - { 0x00000006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(549) }, /* BeaconRxCount */ \ - { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(553) }, /* PacketMulticastRxCount */ \ - { 0x00000008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(557) }, /* PacketMulticastTxCount */ \ - { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(561) }, /* PacketUnicastRxCount */ \ - { 0x0000000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(565) }, /* PacketUnicastTxCount */ \ - { 0x0000000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(569) }, /* CurrentMaxRate */ \ - { 0x0000000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(577) }, /* OverrunCount */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(585) }, /* FeatureMap */ \ + { 0x00000005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(525) }, /* BeaconLostCount */ \ + { 0x00000006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(529) }, /* BeaconRxCount */ \ + { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(533) }, /* PacketMulticastRxCount */ \ + { 0x00000008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(537) }, /* PacketMulticastTxCount */ \ + { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(541) }, /* PacketUnicastRxCount */ \ + { 0x0000000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(545) }, /* PacketUnicastTxCount */ \ + { 0x0000000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(549) }, /* CurrentMaxRate */ \ + { 0x0000000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(557) }, /* OverrunCount */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(565) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* PHYRate */ \ { 0x00000001, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* FullDuplex */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(589) }, /* PacketRxCount */ \ - { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(597) }, /* PacketTxCount */ \ - { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(605) }, /* TxErrCount */ \ - { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(613) }, /* CollisionCount */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(621) }, /* OverrunCount */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(569) }, /* PacketRxCount */ \ + { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(577) }, /* PacketTxCount */ \ + { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(585) }, /* TxErrCount */ \ + { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(593) }, /* CollisionCount */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(601) }, /* OverrunCount */ \ { 0x00000007, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* CarrierDetect */ \ - { 0x00000008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(629) }, /* TimeSinceReset */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(637) }, /* FeatureMap */ \ + { 0x00000008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(609) }, /* TimeSinceReset */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(617) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { 0x00000000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* WindowStatus */ \ + { 0x00000000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ { 0x00000001, ZAP_TYPE(FABRIC_IDX), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* AdminVendorId */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ @@ -855,12 +822,11 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Pump Configuration and Control (client) */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ @@ -961,93 +927,276 @@ #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask #define GENERATED_CLUSTER_COUNT 24 -#define GENERATED_CLUSTERS \ - { \ - { \ - 0x00000008, ZAP_ATTRIBUTE_INDEX(0), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 0, Cluster: Level Control (client) */ \ - { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(1), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { 0x00000028, \ - ZAP_ATTRIBUTE_INDEX(6), \ - 20, \ - 39, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayBasicServer }, /* Endpoint: 0, Cluster: Basic (server) */ \ - { 0x0000002B, \ - ZAP_ATTRIBUTE_INDEX(26), \ - 3, \ - 38, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayLocalizationConfigurationServer }, /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ - { 0x0000002C, \ - ZAP_ATTRIBUTE_INDEX(29), \ - 4, \ - 4, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayTimeFormatLocalizationServer }, /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ - { 0x0000002D, \ - ZAP_ATTRIBUTE_INDEX(33), \ - 3, \ - 7, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayUnitLocalizationServer }, /* Endpoint: 0, Cluster: Unit Localization (server) */ \ - { \ - 0x00000030, ZAP_ATTRIBUTE_INDEX(33), 6, 270, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { \ - 0x00000031, ZAP_ATTRIBUTE_INDEX(39), 10, 60, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { \ - 0x00000032, ZAP_ATTRIBUTE_INDEX(52), 0, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ - { \ - 0x00000033, ZAP_ATTRIBUTE_INDEX(52), 9, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ - { \ - 0x00000034, ZAP_ATTRIBUTE_INDEX(61), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { \ - 0x00000035, ZAP_ATTRIBUTE_INDEX(67), 65, 247, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { \ - 0x00000036, ZAP_ATTRIBUTE_INDEX(132), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ - { \ - 0x00000037, ZAP_ATTRIBUTE_INDEX(147), 11, 57, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ - { \ - 0x0000003C, ZAP_ATTRIBUTE_INDEX(158), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(162), 7, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(169), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ - { \ - 0x00000041, ZAP_ATTRIBUTE_INDEX(171), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: User Label (server) */ \ - { \ - 0x00000006, ZAP_ATTRIBUTE_INDEX(173), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 1, Cluster: On/Off (client) */ \ - { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(174), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ - { \ - 0x00000200, ZAP_ATTRIBUTE_INDEX(179), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 1, Cluster: Pump Configuration and Control (client) */ \ - { \ - 0x00000402, ZAP_ATTRIBUTE_INDEX(180), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 1, Cluster: Temperature Measurement (client) */ \ - { \ - 0x00000403, ZAP_ATTRIBUTE_INDEX(181), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 1, Cluster: Pressure Measurement (client) */ \ - { \ - 0x00000404, ZAP_ATTRIBUTE_INDEX(182), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 1, Cluster: Flow Measurement (client) */ \ - } + +// clang-format off +#define GENERATED_CLUSTERS { \ + { \ + /* Endpoint: 0, Cluster: Level Control (client) */ \ + .clusterId = 0x00000008, \ + .attributes = ZAP_ATTRIBUTE_INDEX(0), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 0 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Descriptor (server) */ \ + .clusterId = 0x0000001D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(1), \ + .attributeCount = 5, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Basic (server) */ \ + .clusterId = 0x00000028, \ + .attributes = ZAP_ATTRIBUTE_INDEX(6), \ + .attributeCount = 20, \ + .clusterSize = 39, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayBasicServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ + .clusterId = 0x0000002B, \ + .attributes = ZAP_ATTRIBUTE_INDEX(26), \ + .attributeCount = 3, \ + .clusterSize = 38, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayLocalizationConfigurationServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ + .clusterId = 0x0000002C, \ + .attributes = ZAP_ATTRIBUTE_INDEX(29), \ + .attributeCount = 4, \ + .clusterSize = 4, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayTimeFormatLocalizationServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Unit Localization (server) */ \ + .clusterId = 0x0000002D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(33), \ + .attributeCount = 3, \ + .clusterSize = 7, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: General Commissioning (server) */ \ + .clusterId = 0x00000030, \ + .attributes = ZAP_ATTRIBUTE_INDEX(36), \ + .attributeCount = 6, \ + .clusterSize = 270, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 9 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 13 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ + .clusterId = 0x00000031, \ + .attributes = ZAP_ATTRIBUTE_INDEX(42), \ + .attributeCount = 10, \ + .clusterSize = 60, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 16 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 23 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ + .clusterId = 0x00000032, \ + .attributes = ZAP_ATTRIBUTE_INDEX(52), \ + .attributeCount = 0, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 26 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ + .clusterId = 0x00000033, \ + .attributes = ZAP_ATTRIBUTE_INDEX(52), \ + .attributeCount = 9, \ + .clusterSize = 17, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ + .clusterId = 0x00000034, \ + .attributes = ZAP_ATTRIBUTE_INDEX(61), \ + .attributeCount = 6, \ + .clusterSize = 30, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 28 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ + .clusterId = 0x00000035, \ + .attributes = ZAP_ATTRIBUTE_INDEX(67), \ + .attributeCount = 65, \ + .clusterSize = 247, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ + .clusterId = 0x00000036, \ + .attributes = ZAP_ATTRIBUTE_INDEX(132), \ + .attributeCount = 15, \ + .clusterSize = 58, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ + .clusterId = 0x00000037, \ + .attributes = ZAP_ATTRIBUTE_INDEX(147), \ + .attributeCount = 11, \ + .clusterSize = 57, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 30 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ + .clusterId = 0x0000003C, \ + .attributes = ZAP_ATTRIBUTE_INDEX(158), \ + .attributeCount = 4, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 32 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ + .clusterId = 0x0000003E, \ + .attributes = ZAP_ATTRIBUTE_INDEX(162), \ + .attributeCount = 7, \ + .clusterSize = 4, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 36 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 46 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Fixed Label (server) */ \ + .clusterId = 0x00000040, \ + .attributes = ZAP_ATTRIBUTE_INDEX(169), \ + .attributeCount = 2, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: User Label (server) */ \ + .clusterId = 0x00000041, \ + .attributes = ZAP_ATTRIBUTE_INDEX(171), \ + .attributeCount = 2, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: On/Off (client) */ \ + .clusterId = 0x00000006, \ + .attributes = ZAP_ATTRIBUTE_INDEX(173), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 51 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Descriptor (server) */ \ + .clusterId = 0x0000001D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(174), \ + .attributeCount = 5, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Pump Configuration and Control (client) */ \ + .clusterId = 0x00000200, \ + .attributes = ZAP_ATTRIBUTE_INDEX(179), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Temperature Measurement (client) */ \ + .clusterId = 0x00000402, \ + .attributes = ZAP_ATTRIBUTE_INDEX(180), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Pressure Measurement (client) */ \ + .clusterId = 0x00000403, \ + .attributes = ZAP_ATTRIBUTE_INDEX(181), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Flow Measurement (client) */ \ + .clusterId = 0x00000404, \ + .attributes = ZAP_ATTRIBUTE_INDEX(182), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ +} + +// clang-format on #define ZAP_CLUSTER_INDEX(index) (&generatedClusters[index]) @@ -1056,7 +1205,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 17, 1480 }, { ZAP_CLUSTER_INDEX(17), 6, 10 }, \ + { ZAP_CLUSTER_INDEX(0), 18, 839 }, { ZAP_CLUSTER_INDEX(18), 6, 10 }, \ } // Largest attribute size is needed for various buffers @@ -1066,7 +1215,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (39) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (1490) +#define ATTRIBUTE_MAX_SIZE (849) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (2) diff --git a/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h b/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h index bdc5847581efc4..1a82b193268d7d 100644 --- a/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h +++ b/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h @@ -42,7 +42,7 @@ /* 10 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 38 - BasicCommissioningInfoList, */ \ + /* 18 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -58,86 +58,86 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 292 - FeatureMap, */ \ + /* 272 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x02, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), big-endian */ \ \ - /* 296 - Networks, */ \ + /* 276 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 308 - LastConnectErrorValue, */ \ + /* 288 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 312 - FeatureMap, */ \ + /* 292 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), big-endian */ \ \ - /* 316 - UpTime, */ \ + /* 296 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 324 - TotalOperationalHours, */ \ + /* 304 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), big-endian */ \ \ - /* 328 - CurrentHeapHighWatermark, */ \ + /* 308 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 336 - FeatureMap, */ \ + /* 316 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), big-endian */ \ \ - /* 340 - BeaconLostCount, */ \ + /* 320 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 344 - BeaconRxCount, */ \ + /* 324 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 348 - PacketMulticastRxCount, */ \ + /* 328 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 352 - PacketMulticastTxCount, */ \ + /* 332 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 356 - PacketUnicastRxCount, */ \ + /* 336 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 360 - PacketUnicastTxCount, */ \ + /* 340 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 364 - CurrentMaxRate, */ \ + /* 344 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 372 - OverrunCount, */ \ + /* 352 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 380 - FeatureMap, */ \ + /* 360 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), big-endian */ \ \ - /* 384 - PacketRxCount, */ \ + /* 364 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 392 - PacketTxCount, */ \ + /* 372 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 400 - TxErrCount, */ \ + /* 380 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 408 - CollisionCount, */ \ + /* 388 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 416 - OverrunCount, */ \ + /* 396 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 424 - TimeSinceReset, */ \ + /* 404 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 432 - FeatureMap, */ \ + /* 412 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ } @@ -160,7 +160,7 @@ /* 10 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 38 - BasicCommissioningInfoList, */ \ + /* 18 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -176,92 +176,92 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 292 - FeatureMap, */ \ + /* 272 - FeatureMap, */ \ 0x02, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), little-endian */ \ \ - /* 296 - Networks, */ \ + /* 276 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 308 - LastConnectErrorValue, */ \ + /* 288 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 312 - FeatureMap, */ \ + /* 292 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), little-endian */ \ \ - /* 316 - UpTime, */ \ + /* 296 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 324 - TotalOperationalHours, */ \ + /* 304 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), little-endian */ \ \ - /* 328 - CurrentHeapHighWatermark, */ \ + /* 308 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 336 - FeatureMap, */ \ + /* 316 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), little-endian */ \ \ - /* 340 - BeaconLostCount, */ \ + /* 320 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 344 - BeaconRxCount, */ \ + /* 324 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 348 - PacketMulticastRxCount, */ \ + /* 328 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 352 - PacketMulticastTxCount, */ \ + /* 332 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 356 - PacketUnicastRxCount, */ \ + /* 336 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 360 - PacketUnicastTxCount, */ \ + /* 340 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 364 - CurrentMaxRate, */ \ + /* 344 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 372 - OverrunCount, */ \ + /* 352 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 380 - FeatureMap, */ \ + /* 360 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), little-endian */ \ \ - /* 384 - PacketRxCount, */ \ + /* 364 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 392 - PacketTxCount, */ \ + /* 372 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 400 - TxErrCount, */ \ + /* 380 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 408 - CollisionCount, */ \ + /* 388 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 416 - OverrunCount, */ \ + /* 396 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 424 - TimeSinceReset, */ \ + /* 404 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 432 - FeatureMap, */ \ + /* 412 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ } #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (30) +#define GENERATED_DEFAULTS_COUNT (28) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -299,12 +299,11 @@ { \ \ /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Access Control (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -379,30 +378,30 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x00000000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(30) }, /* Breadcrumb */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(38) }, /* BasicCommissioningInfoList */ \ + { 0x00000000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(10) }, /* Breadcrumb */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(18) }, /* BasicCommissioningInfoList */ \ { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* RegulatoryConfig */ \ { 0x00000003, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* LocationCapability */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(292) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(272) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* MaxNetworks */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(296) }, /* Networks */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(276) }, /* Networks */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ScanMaxTimeSeconds */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ConnectMaxTimeSeconds */ \ { 0x00000004, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* InterfaceEnabled */ \ { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkingStatus */ \ { 0x00000006, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkID */ \ - { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(308) }, /* LastConnectErrorValue */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(312) }, /* FeatureMap */ \ + { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(288) }, /* LastConnectErrorValue */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(292) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NetworkInterfaces */ \ { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* RebootCount */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(316) }, /* UpTime */ \ - { 0x00000003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(324) }, /* TotalOperationalHours */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(296) }, /* UpTime */ \ + { 0x00000003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(304) }, /* TotalOperationalHours */ \ { 0x00000004, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BootReasons */ \ { 0x00000005, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* ActiveHardwareFaults */ \ @@ -412,8 +411,8 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(328) }, /* CurrentHeapHighWatermark */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(336) }, /* FeatureMap */ \ + { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(308) }, /* CurrentHeapHighWatermark */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(316) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ @@ -422,36 +421,36 @@ { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* WiFiVersion */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChannelNumber */ \ { 0x00000004, ZAP_TYPE(INT8S), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Rssi */ \ - { 0x00000005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(340) }, /* BeaconLostCount */ \ - { 0x00000006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(344) }, /* BeaconRxCount */ \ - { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(348) }, /* PacketMulticastRxCount */ \ - { 0x00000008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(352) }, /* PacketMulticastTxCount */ \ - { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(356) }, /* PacketUnicastRxCount */ \ - { 0x0000000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(360) }, /* PacketUnicastTxCount */ \ - { 0x0000000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(364) }, /* CurrentMaxRate */ \ - { 0x0000000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(372) }, /* OverrunCount */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(380) }, /* FeatureMap */ \ + { 0x00000005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(320) }, /* BeaconLostCount */ \ + { 0x00000006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(324) }, /* BeaconRxCount */ \ + { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(328) }, /* PacketMulticastRxCount */ \ + { 0x00000008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(332) }, /* PacketMulticastTxCount */ \ + { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(336) }, /* PacketUnicastRxCount */ \ + { 0x0000000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(340) }, /* PacketUnicastTxCount */ \ + { 0x0000000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(344) }, /* CurrentMaxRate */ \ + { 0x0000000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(352) }, /* OverrunCount */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(360) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* PHYRate */ \ { 0x00000001, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* FullDuplex */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(384) }, /* PacketRxCount */ \ - { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(392) }, /* PacketTxCount */ \ - { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(400) }, /* TxErrCount */ \ - { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(408) }, /* CollisionCount */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(416) }, /* OverrunCount */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(364) }, /* PacketRxCount */ \ + { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(372) }, /* PacketTxCount */ \ + { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(380) }, /* TxErrCount */ \ + { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(388) }, /* CollisionCount */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(396) }, /* OverrunCount */ \ { 0x00000007, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* CarrierDetect */ \ - { 0x00000008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(424) }, /* TimeSinceReset */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(432) }, /* FeatureMap */ \ + { 0x00000008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(404) }, /* TimeSinceReset */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(412) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { 0x00000000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* WindowStatus */ \ + { 0x00000000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ { 0x00000001, ZAP_TYPE(FABRIC_IDX), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* AdminVendorId */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ @@ -474,12 +473,11 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ { 0x00000000, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MeasuredValue */ \ @@ -573,75 +571,210 @@ #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask #define GENERATED_CLUSTER_COUNT 18 -#define GENERATED_CLUSTERS \ - { \ - { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(0), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { 0x00000028, \ - ZAP_ATTRIBUTE_INDEX(5), \ - 20, \ - 39, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayBasicServer }, /* Endpoint: 0, Cluster: Basic (server) */ \ - { 0x0000002B, \ - ZAP_ATTRIBUTE_INDEX(25), \ - 3, \ - 38, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayLocalizationConfigurationServer }, /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ - { 0x0000002C, \ - ZAP_ATTRIBUTE_INDEX(28), \ - 4, \ - 4, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayTimeFormatLocalizationServer }, /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ - { 0x0000002D, \ - ZAP_ATTRIBUTE_INDEX(32), \ - 3, \ - 7, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayUnitLocalizationServer }, /* Endpoint: 0, Cluster: Unit Localization (server) */ \ - { \ - 0x00000030, ZAP_ATTRIBUTE_INDEX(32), 6, 270, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { \ - 0x00000031, ZAP_ATTRIBUTE_INDEX(38), 10, 60, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { \ - 0x00000032, ZAP_ATTRIBUTE_INDEX(51), 0, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ - { \ - 0x00000033, ZAP_ATTRIBUTE_INDEX(51), 9, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ - { \ - 0x00000034, ZAP_ATTRIBUTE_INDEX(60), 3, 14, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { \ - 0x00000036, ZAP_ATTRIBUTE_INDEX(63), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ - { \ - 0x00000037, ZAP_ATTRIBUTE_INDEX(78), 11, 57, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ - { \ - 0x0000003C, ZAP_ATTRIBUTE_INDEX(89), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(93), 7, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(100), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ - { \ - 0x00000041, ZAP_ATTRIBUTE_INDEX(102), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: User Label (server) */ \ - { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(104), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ - { \ - 0x00000402, ZAP_ATTRIBUTE_INDEX(109), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ - } + +// clang-format off +#define GENERATED_CLUSTERS { \ + { \ + /* Endpoint: 0, Cluster: Descriptor (server) */ \ + .clusterId = 0x0000001D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(0), \ + .attributeCount = 5, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Basic (server) */ \ + .clusterId = 0x00000028, \ + .attributes = ZAP_ATTRIBUTE_INDEX(5), \ + .attributeCount = 20, \ + .clusterSize = 39, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayBasicServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ + .clusterId = 0x0000002B, \ + .attributes = ZAP_ATTRIBUTE_INDEX(25), \ + .attributeCount = 3, \ + .clusterSize = 38, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayLocalizationConfigurationServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ + .clusterId = 0x0000002C, \ + .attributes = ZAP_ATTRIBUTE_INDEX(28), \ + .attributeCount = 4, \ + .clusterSize = 4, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayTimeFormatLocalizationServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Unit Localization (server) */ \ + .clusterId = 0x0000002D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(32), \ + .attributeCount = 3, \ + .clusterSize = 7, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: General Commissioning (server) */ \ + .clusterId = 0x00000030, \ + .attributes = ZAP_ATTRIBUTE_INDEX(35), \ + .attributeCount = 6, \ + .clusterSize = 270, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 0 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 4 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ + .clusterId = 0x00000031, \ + .attributes = ZAP_ATTRIBUTE_INDEX(41), \ + .attributeCount = 10, \ + .clusterSize = 60, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 7 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 13 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ + .clusterId = 0x00000032, \ + .attributes = ZAP_ATTRIBUTE_INDEX(51), \ + .attributeCount = 0, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 16 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ + .clusterId = 0x00000033, \ + .attributes = ZAP_ATTRIBUTE_INDEX(51), \ + .attributeCount = 9, \ + .clusterSize = 17, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ + .clusterId = 0x00000034, \ + .attributes = ZAP_ATTRIBUTE_INDEX(60), \ + .attributeCount = 3, \ + .clusterSize = 14, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 18 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ + .clusterId = 0x00000036, \ + .attributes = ZAP_ATTRIBUTE_INDEX(63), \ + .attributeCount = 15, \ + .clusterSize = 58, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ + .clusterId = 0x00000037, \ + .attributes = ZAP_ATTRIBUTE_INDEX(78), \ + .attributeCount = 11, \ + .clusterSize = 57, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 20 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ + .clusterId = 0x0000003C, \ + .attributes = ZAP_ATTRIBUTE_INDEX(89), \ + .attributeCount = 4, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 22 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ + .clusterId = 0x0000003E, \ + .attributes = ZAP_ATTRIBUTE_INDEX(93), \ + .attributeCount = 7, \ + .clusterSize = 4, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 26 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 36 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Fixed Label (server) */ \ + .clusterId = 0x00000040, \ + .attributes = ZAP_ATTRIBUTE_INDEX(100), \ + .attributeCount = 2, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: User Label (server) */ \ + .clusterId = 0x00000041, \ + .attributes = ZAP_ATTRIBUTE_INDEX(102), \ + .attributeCount = 2, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Descriptor (server) */ \ + .clusterId = 0x0000001D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(104), \ + .attributeCount = 5, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ + .clusterId = 0x00000402, \ + .attributes = ZAP_ATTRIBUTE_INDEX(109), \ + .attributeCount = 4, \ + .clusterSize = 8, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ +} + +// clang-format on #define ZAP_CLUSTER_INDEX(index) (&generatedClusters[index]) @@ -650,7 +783,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 15, 1215 }, { ZAP_CLUSTER_INDEX(15), 2, 8 }, \ + { ZAP_CLUSTER_INDEX(0), 16, 574 }, { ZAP_CLUSTER_INDEX(16), 2, 8 }, \ } // Largest attribute size is needed for various buffers @@ -660,7 +793,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (39) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (1223) +#define ATTRIBUTE_MAX_SIZE (582) // 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 073dc2df3af70d..35a15a096b1241 100644 --- a/zzz_generated/thermostat/zap-generated/endpoint_config.h +++ b/zzz_generated/thermostat/zap-generated/endpoint_config.h @@ -42,7 +42,7 @@ /* 10 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 38 - BasicCommissioningInfoList, */ \ + /* 18 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -58,228 +58,228 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 292 - FeatureMap, */ \ + /* 272 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x06, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), big-endian */ \ \ - /* 296 - Networks, */ \ + /* 276 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 308 - LastConnectErrorValue, */ \ + /* 288 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 312 - FeatureMap, */ \ + /* 292 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), big-endian */ \ \ - /* 316 - UpTime, */ \ + /* 296 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 324 - TotalOperationalHours, */ \ + /* 304 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), big-endian */ \ \ - /* 328 - CurrentHeapFree, */ \ + /* 308 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 336 - CurrentHeapUsed, */ \ + /* 316 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 344 - CurrentHeapHighWatermark, */ \ + /* 324 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 352 - FeatureMap, */ \ + /* 332 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), big-endian */ \ \ - /* 356 - NetworkName, */ \ + /* 336 - NetworkName, */ \ 0x00, 0x00, \ \ - /* 358 - ExtendedPanId, */ \ + /* 338 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 366 - OverrunCount, */ \ + /* 346 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 374 - PartitionId, */ \ + /* 354 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 378 - TxTotalCount, */ \ + /* 358 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 382 - TxUnicastCount, */ \ + /* 362 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 386 - TxBroadcastCount, */ \ + /* 366 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 390 - TxAckRequestedCount, */ \ + /* 370 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 394 - TxAckedCount, */ \ + /* 374 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 398 - TxNoAckRequestedCount, */ \ + /* 378 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 402 - TxDataCount, */ \ + /* 382 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 406 - TxDataPollCount, */ \ + /* 386 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 410 - TxBeaconCount, */ \ + /* 390 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 414 - TxBeaconRequestCount, */ \ + /* 394 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 418 - TxOtherCount, */ \ + /* 398 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 422 - TxRetryCount, */ \ + /* 402 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 426 - TxDirectMaxRetryExpiryCount, */ \ + /* 406 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 430 - TxIndirectMaxRetryExpiryCount, */ \ + /* 410 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 434 - TxErrCcaCount, */ \ + /* 414 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 438 - TxErrAbortCount, */ \ + /* 418 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 442 - TxErrBusyChannelCount, */ \ + /* 422 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 446 - RxTotalCount, */ \ + /* 426 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 450 - RxUnicastCount, */ \ + /* 430 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 454 - RxBroadcastCount, */ \ + /* 434 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 458 - RxDataCount, */ \ + /* 438 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 462 - RxDataPollCount, */ \ + /* 442 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 466 - RxBeaconCount, */ \ + /* 446 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 470 - RxBeaconRequestCount, */ \ + /* 450 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 474 - RxOtherCount, */ \ + /* 454 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 478 - RxAddressFilteredCount, */ \ + /* 458 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 482 - RxDestAddrFilteredCount, */ \ + /* 462 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 486 - RxDuplicatedCount, */ \ + /* 466 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 490 - RxErrNoFrameCount, */ \ + /* 470 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 494 - RxErrUnknownNeighborCount, */ \ + /* 474 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 498 - RxErrInvalidSrcAddrCount, */ \ + /* 478 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 502 - RxErrSecCount, */ \ + /* 482 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 506 - RxErrFcsCount, */ \ + /* 486 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 510 - RxErrOtherCount, */ \ + /* 490 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 514 - ActiveTimestamp, */ \ + /* 494 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 522 - PendingTimestamp, */ \ + /* 502 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 530 - delay, */ \ + /* 510 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 534 - ChannelMask, */ \ + /* 514 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 541 - FeatureMap, */ \ + /* 521 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0F, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), big-endian */ \ \ - /* 545 - BeaconLostCount, */ \ + /* 525 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 549 - BeaconRxCount, */ \ + /* 529 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 553 - PacketMulticastRxCount, */ \ + /* 533 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 557 - PacketMulticastTxCount, */ \ + /* 537 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 561 - PacketUnicastRxCount, */ \ + /* 541 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 565 - PacketUnicastTxCount, */ \ + /* 545 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 569 - CurrentMaxRate, */ \ + /* 549 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 577 - OverrunCount, */ \ + /* 557 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 585 - FeatureMap, */ \ + /* 565 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), big-endian */ \ \ - /* 589 - PacketRxCount, */ \ + /* 569 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 597 - PacketTxCount, */ \ + /* 577 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 605 - TxErrCount, */ \ + /* 585 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 613 - CollisionCount, */ \ + /* 593 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 621 - OverrunCount, */ \ + /* 601 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 629 - TimeSinceReset, */ \ + /* 609 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 637 - FeatureMap, */ \ + /* 617 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ /* Endpoint: 0, Cluster: Group Key Management (server), big-endian */ \ \ - /* 641 - GroupKeyMap, */ \ + /* 621 - GroupKeyMap, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -295,7 +295,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 895 - GroupTable, */ \ + /* 875 - GroupTable, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -311,20 +311,9 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* Endpoint: 1, Cluster: Basic (server), big-endian */ \ - \ - /* 1149 - Location, */ \ - 2, 'X', 'X', \ - \ - /* 1152 - SoftwareVersion, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 1156 - ManufacturingDate, */ \ - 16, '2', '0', '2', '1', '0', '6', '1', '4', '1', '2', '3', '4', '5', '6', 'Z', 'Z', \ - \ /* Endpoint: 1, Cluster: Thermostat (server), big-endian */ \ \ - /* 1173 - FeatureMap, */ \ + /* 1129 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0B, \ } @@ -347,7 +336,7 @@ /* 10 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 38 - BasicCommissioningInfoList, */ \ + /* 18 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -363,228 +352,228 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 292 - FeatureMap, */ \ + /* 272 - FeatureMap, */ \ 0x06, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), little-endian */ \ \ - /* 296 - Networks, */ \ + /* 276 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 308 - LastConnectErrorValue, */ \ + /* 288 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 312 - FeatureMap, */ \ + /* 292 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), little-endian */ \ \ - /* 316 - UpTime, */ \ + /* 296 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 324 - TotalOperationalHours, */ \ + /* 304 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), little-endian */ \ \ - /* 328 - CurrentHeapFree, */ \ + /* 308 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 336 - CurrentHeapUsed, */ \ + /* 316 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 344 - CurrentHeapHighWatermark, */ \ + /* 324 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 352 - FeatureMap, */ \ + /* 332 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), little-endian */ \ \ - /* 356 - NetworkName, */ \ + /* 336 - NetworkName, */ \ 0x00, 0x00, \ \ - /* 358 - ExtendedPanId, */ \ + /* 338 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 366 - OverrunCount, */ \ + /* 346 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 374 - PartitionId, */ \ + /* 354 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 378 - TxTotalCount, */ \ + /* 358 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 382 - TxUnicastCount, */ \ + /* 362 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 386 - TxBroadcastCount, */ \ + /* 366 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 390 - TxAckRequestedCount, */ \ + /* 370 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 394 - TxAckedCount, */ \ + /* 374 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 398 - TxNoAckRequestedCount, */ \ + /* 378 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 402 - TxDataCount, */ \ + /* 382 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 406 - TxDataPollCount, */ \ + /* 386 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 410 - TxBeaconCount, */ \ + /* 390 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 414 - TxBeaconRequestCount, */ \ + /* 394 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 418 - TxOtherCount, */ \ + /* 398 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 422 - TxRetryCount, */ \ + /* 402 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 426 - TxDirectMaxRetryExpiryCount, */ \ + /* 406 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 430 - TxIndirectMaxRetryExpiryCount, */ \ + /* 410 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 434 - TxErrCcaCount, */ \ + /* 414 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 438 - TxErrAbortCount, */ \ + /* 418 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 442 - TxErrBusyChannelCount, */ \ + /* 422 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 446 - RxTotalCount, */ \ + /* 426 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 450 - RxUnicastCount, */ \ + /* 430 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 454 - RxBroadcastCount, */ \ + /* 434 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 458 - RxDataCount, */ \ + /* 438 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 462 - RxDataPollCount, */ \ + /* 442 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 466 - RxBeaconCount, */ \ + /* 446 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 470 - RxBeaconRequestCount, */ \ + /* 450 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 474 - RxOtherCount, */ \ + /* 454 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 478 - RxAddressFilteredCount, */ \ + /* 458 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 482 - RxDestAddrFilteredCount, */ \ + /* 462 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 486 - RxDuplicatedCount, */ \ + /* 466 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 490 - RxErrNoFrameCount, */ \ + /* 470 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 494 - RxErrUnknownNeighborCount, */ \ + /* 474 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 498 - RxErrInvalidSrcAddrCount, */ \ + /* 478 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 502 - RxErrSecCount, */ \ + /* 482 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 506 - RxErrFcsCount, */ \ + /* 486 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 510 - RxErrOtherCount, */ \ + /* 490 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 514 - ActiveTimestamp, */ \ + /* 494 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 522 - PendingTimestamp, */ \ + /* 502 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 530 - delay, */ \ + /* 510 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 534 - ChannelMask, */ \ + /* 514 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 541 - FeatureMap, */ \ + /* 521 - FeatureMap, */ \ 0x0F, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), little-endian */ \ \ - /* 545 - BeaconLostCount, */ \ + /* 525 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 549 - BeaconRxCount, */ \ + /* 529 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 553 - PacketMulticastRxCount, */ \ + /* 533 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 557 - PacketMulticastTxCount, */ \ + /* 537 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 561 - PacketUnicastRxCount, */ \ + /* 541 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 565 - PacketUnicastTxCount, */ \ + /* 545 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 569 - CurrentMaxRate, */ \ + /* 549 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 577 - OverrunCount, */ \ + /* 557 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 585 - FeatureMap, */ \ + /* 565 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), little-endian */ \ \ - /* 589 - PacketRxCount, */ \ + /* 569 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 597 - PacketTxCount, */ \ + /* 577 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 605 - TxErrCount, */ \ + /* 585 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 613 - CollisionCount, */ \ + /* 593 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 621 - OverrunCount, */ \ + /* 601 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 629 - TimeSinceReset, */ \ + /* 609 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 637 - FeatureMap, */ \ + /* 617 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Group Key Management (server), little-endian */ \ \ - /* 641 - GroupKeyMap, */ \ + /* 621 - GroupKeyMap, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -600,7 +589,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 895 - GroupTable, */ \ + /* 875 - GroupTable, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -616,26 +605,15 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* Endpoint: 1, Cluster: Basic (server), little-endian */ \ - \ - /* 1149 - Location, */ \ - 2, 'X', 'X', \ - \ - /* 1152 - SoftwareVersion, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 1156 - ManufacturingDate, */ \ - 16, '2', '0', '2', '1', '0', '6', '1', '4', '1', '2', '3', '4', '5', '6', 'Z', 'Z', \ - \ /* Endpoint: 1, Cluster: Thermostat (server), little-endian */ \ \ - /* 1173 - FeatureMap, */ \ + /* 1129 - FeatureMap, */ \ 0x0B, 0x00, 0x00, 0x00, \ } #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (81) +#define GENERATED_DEFAULTS_COUNT (76) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -693,12 +671,11 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Binding (server) */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ @@ -779,30 +756,30 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x00000000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(30) }, /* Breadcrumb */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(38) }, /* BasicCommissioningInfoList */ \ + { 0x00000000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(10) }, /* Breadcrumb */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(18) }, /* BasicCommissioningInfoList */ \ { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* RegulatoryConfig */ \ { 0x00000003, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* LocationCapability */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(292) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(272) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* MaxNetworks */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(296) }, /* Networks */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(276) }, /* Networks */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ScanMaxTimeSeconds */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ConnectMaxTimeSeconds */ \ { 0x00000004, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* InterfaceEnabled */ \ { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkingStatus */ \ { 0x00000006, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkID */ \ - { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(308) }, /* LastConnectErrorValue */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(312) }, /* FeatureMap */ \ + { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(288) }, /* LastConnectErrorValue */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(292) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NetworkInterfaces */ \ { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* RebootCount */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(316) }, /* UpTime */ \ - { 0x00000003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(324) }, /* TotalOperationalHours */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(296) }, /* UpTime */ \ + { 0x00000003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(304) }, /* TotalOperationalHours */ \ { 0x00000004, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BootReasons */ \ { 0x00000005, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* ActiveHardwareFaults */ \ @@ -813,23 +790,23 @@ \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ThreadMetrics */ \ - { 0x00000001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(328) }, /* CurrentHeapFree */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(336) }, /* CurrentHeapUsed */ \ - { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(344) }, /* CurrentHeapHighWatermark */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(352) }, /* FeatureMap */ \ + { 0x00000001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(308) }, /* CurrentHeapFree */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(316) }, /* CurrentHeapUsed */ \ + { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(324) }, /* CurrentHeapHighWatermark */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(332) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x00000001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ - { 0x00000002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(356) }, /* NetworkName */ \ + { 0x00000002, ZAP_TYPE(CHAR_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(336) }, /* NetworkName */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ - { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(358) }, /* ExtendedPanId */ \ + { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(338) }, /* ExtendedPanId */ \ { 0x00000005, ZAP_TYPE(OCTET_STRING), 18, 0, ZAP_EMPTY_DEFAULT() }, /* MeshLocalPrefix */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(366) }, /* OverrunCount */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(346) }, /* OverrunCount */ \ { 0x00000007, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NeighborTableList */ \ { 0x00000008, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* RouteTableList */ \ - { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(374) }, /* PartitionId */ \ + { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(354) }, /* PartitionId */ \ { 0x0000000A, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* weighting */ \ { 0x0000000B, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* DataVersion */ \ { 0x0000000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* StableDataVersion */ \ @@ -842,50 +819,50 @@ { 0x00000013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PartitionIdChangeCount */ \ { 0x00000014, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* BetterPartitionAttachAttemptCount */ \ { 0x00000015, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ParentChangeCount */ \ - { 0x00000016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(378) }, /* TxTotalCount */ \ - { 0x00000017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(382) }, /* TxUnicastCount */ \ - { 0x00000018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(386) }, /* TxBroadcastCount */ \ - { 0x00000019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(390) }, /* TxAckRequestedCount */ \ - { 0x0000001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(394) }, /* TxAckedCount */ \ - { 0x0000001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(398) }, /* TxNoAckRequestedCount */ \ - { 0x0000001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(402) }, /* TxDataCount */ \ - { 0x0000001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(406) }, /* TxDataPollCount */ \ - { 0x0000001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(410) }, /* TxBeaconCount */ \ - { 0x0000001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(414) }, /* TxBeaconRequestCount */ \ - { 0x00000020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(418) }, /* TxOtherCount */ \ - { 0x00000021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(422) }, /* TxRetryCount */ \ - { 0x00000022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(426) }, /* TxDirectMaxRetryExpiryCount */ \ - { 0x00000023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(430) }, /* TxIndirectMaxRetryExpiryCount */ \ - { 0x00000024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(434) }, /* TxErrCcaCount */ \ - { 0x00000025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(438) }, /* TxErrAbortCount */ \ - { 0x00000026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(442) }, /* TxErrBusyChannelCount */ \ - { 0x00000027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(446) }, /* RxTotalCount */ \ - { 0x00000028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(450) }, /* RxUnicastCount */ \ - { 0x00000029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(454) }, /* RxBroadcastCount */ \ - { 0x0000002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(458) }, /* RxDataCount */ \ - { 0x0000002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(462) }, /* RxDataPollCount */ \ - { 0x0000002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(466) }, /* RxBeaconCount */ \ - { 0x0000002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(470) }, /* RxBeaconRequestCount */ \ - { 0x0000002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(474) }, /* RxOtherCount */ \ - { 0x0000002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(478) }, /* RxAddressFilteredCount */ \ - { 0x00000030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(482) }, /* RxDestAddrFilteredCount */ \ - { 0x00000031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(486) }, /* RxDuplicatedCount */ \ - { 0x00000032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(490) }, /* RxErrNoFrameCount */ \ - { 0x00000033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(494) }, /* RxErrUnknownNeighborCount */ \ - { 0x00000034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(498) }, /* RxErrInvalidSrcAddrCount */ \ - { 0x00000035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(502) }, /* RxErrSecCount */ \ - { 0x00000036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(506) }, /* RxErrFcsCount */ \ - { 0x00000037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(510) }, /* RxErrOtherCount */ \ - { 0x00000038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(514) }, /* ActiveTimestamp */ \ - { 0x00000039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(522) }, /* PendingTimestamp */ \ - { 0x0000003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(530) }, /* delay */ \ + { 0x00000016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(358) }, /* TxTotalCount */ \ + { 0x00000017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(362) }, /* TxUnicastCount */ \ + { 0x00000018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(366) }, /* TxBroadcastCount */ \ + { 0x00000019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(370) }, /* TxAckRequestedCount */ \ + { 0x0000001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(374) }, /* TxAckedCount */ \ + { 0x0000001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(378) }, /* TxNoAckRequestedCount */ \ + { 0x0000001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(382) }, /* TxDataCount */ \ + { 0x0000001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(386) }, /* TxDataPollCount */ \ + { 0x0000001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(390) }, /* TxBeaconCount */ \ + { 0x0000001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(394) }, /* TxBeaconRequestCount */ \ + { 0x00000020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(398) }, /* TxOtherCount */ \ + { 0x00000021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(402) }, /* TxRetryCount */ \ + { 0x00000022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(406) }, /* TxDirectMaxRetryExpiryCount */ \ + { 0x00000023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(410) }, /* TxIndirectMaxRetryExpiryCount */ \ + { 0x00000024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(414) }, /* TxErrCcaCount */ \ + { 0x00000025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(418) }, /* TxErrAbortCount */ \ + { 0x00000026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(422) }, /* TxErrBusyChannelCount */ \ + { 0x00000027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(426) }, /* RxTotalCount */ \ + { 0x00000028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(430) }, /* RxUnicastCount */ \ + { 0x00000029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(434) }, /* RxBroadcastCount */ \ + { 0x0000002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(438) }, /* RxDataCount */ \ + { 0x0000002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(442) }, /* RxDataPollCount */ \ + { 0x0000002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(446) }, /* RxBeaconCount */ \ + { 0x0000002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(450) }, /* RxBeaconRequestCount */ \ + { 0x0000002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(454) }, /* RxOtherCount */ \ + { 0x0000002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(458) }, /* RxAddressFilteredCount */ \ + { 0x00000030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(462) }, /* RxDestAddrFilteredCount */ \ + { 0x00000031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(466) }, /* RxDuplicatedCount */ \ + { 0x00000032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(470) }, /* RxErrNoFrameCount */ \ + { 0x00000033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(474) }, /* RxErrUnknownNeighborCount */ \ + { 0x00000034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(478) }, /* RxErrInvalidSrcAddrCount */ \ + { 0x00000035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(482) }, /* RxErrSecCount */ \ + { 0x00000036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(486) }, /* RxErrFcsCount */ \ + { 0x00000037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(490) }, /* RxErrOtherCount */ \ + { 0x00000038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(494) }, /* ActiveTimestamp */ \ + { 0x00000039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(502) }, /* PendingTimestamp */ \ + { 0x0000003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(510) }, /* delay */ \ { 0x0000003B, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SecurityPolicy */ \ - { 0x0000003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(534) }, /* ChannelMask */ \ + { 0x0000003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(514) }, /* ChannelMask */ \ { 0x0000003D, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* OperationalDatasetComponents */ \ { 0x0000003E, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* ActiveNetworkFaultsList */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(541) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(521) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ @@ -894,36 +871,36 @@ { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* WiFiVersion */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChannelNumber */ \ { 0x00000004, ZAP_TYPE(INT8S), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Rssi */ \ - { 0x00000005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(545) }, /* BeaconLostCount */ \ - { 0x00000006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(549) }, /* BeaconRxCount */ \ - { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(553) }, /* PacketMulticastRxCount */ \ - { 0x00000008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(557) }, /* PacketMulticastTxCount */ \ - { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(561) }, /* PacketUnicastRxCount */ \ - { 0x0000000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(565) }, /* PacketUnicastTxCount */ \ - { 0x0000000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(569) }, /* CurrentMaxRate */ \ - { 0x0000000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(577) }, /* OverrunCount */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(585) }, /* FeatureMap */ \ + { 0x00000005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(525) }, /* BeaconLostCount */ \ + { 0x00000006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(529) }, /* BeaconRxCount */ \ + { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(533) }, /* PacketMulticastRxCount */ \ + { 0x00000008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(537) }, /* PacketMulticastTxCount */ \ + { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(541) }, /* PacketUnicastRxCount */ \ + { 0x0000000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(545) }, /* PacketUnicastTxCount */ \ + { 0x0000000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(549) }, /* CurrentMaxRate */ \ + { 0x0000000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(557) }, /* OverrunCount */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(565) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* PHYRate */ \ { 0x00000001, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* FullDuplex */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(589) }, /* PacketRxCount */ \ - { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(597) }, /* PacketTxCount */ \ - { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(605) }, /* TxErrCount */ \ - { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(613) }, /* CollisionCount */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(621) }, /* OverrunCount */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(569) }, /* PacketRxCount */ \ + { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(577) }, /* PacketTxCount */ \ + { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(585) }, /* TxErrCount */ \ + { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(593) }, /* CollisionCount */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(601) }, /* OverrunCount */ \ { 0x00000007, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* CarrierDetect */ \ - { 0x00000008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(629) }, /* TimeSinceReset */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(637) }, /* FeatureMap */ \ + { 0x00000008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(609) }, /* TimeSinceReset */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(617) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { 0x00000000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* WindowStatus */ \ + { 0x00000000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ { 0x00000001, ZAP_TYPE(FABRIC_IDX), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* AdminVendorId */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ @@ -937,8 +914,8 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(641) }, /* GroupKeyMap */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(895) }, /* GroupTable */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(621) }, /* GroupKeyMap */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(875) }, /* GroupTable */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ @@ -981,22 +958,29 @@ { 0x00000005, ZAP_TYPE(CHAR_STRING), 33, \ ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* NodeLabel */ \ - { 0x00000006, ZAP_TYPE(CHAR_STRING), 3, ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(1149) }, /* Location */ \ - { 0x00000007, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(0) }, /* HardwareVersion */ \ - { 0x00000008, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + { 0x00000006, ZAP_TYPE(CHAR_STRING), 0, \ + ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* Location */ \ + { 0x00000007, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_EMPTY_DEFAULT() }, /* HardwareVersion */ \ + { 0x00000008, ZAP_TYPE(CHAR_STRING), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(SINGLETON), \ ZAP_EMPTY_DEFAULT() }, /* HardwareVersionString */ \ - { 0x00000009, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(SINGLETON), \ - ZAP_LONG_DEFAULTS_INDEX(1152) }, /* SoftwareVersion */ \ - { 0x0000000A, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + { 0x00000009, ZAP_TYPE(INT32U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_EMPTY_DEFAULT() }, /* SoftwareVersion */ \ + { 0x0000000A, ZAP_TYPE(CHAR_STRING), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(SINGLETON), \ ZAP_EMPTY_DEFAULT() }, /* SoftwareVersionString */ \ - { 0x0000000B, ZAP_TYPE(CHAR_STRING), 17, ZAP_ATTRIBUTE_MASK(SINGLETON), \ - ZAP_LONG_DEFAULTS_INDEX(1156) }, /* ManufacturingDate */ \ - { 0x0000000C, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* PartNumber */ \ - { 0x0000000D, ZAP_TYPE(LONG_CHAR_STRING), 258, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* ProductURL */ \ - { 0x0000000E, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* ProductLabel */ \ - { 0x0000000F, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* SerialNumber */ \ - { 0x00000010, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + { 0x0000000B, ZAP_TYPE(CHAR_STRING), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_EMPTY_DEFAULT() }, /* ManufacturingDate */ \ + { 0x0000000C, ZAP_TYPE(CHAR_STRING), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_EMPTY_DEFAULT() }, /* PartNumber */ \ + { 0x0000000D, ZAP_TYPE(LONG_CHAR_STRING), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_EMPTY_DEFAULT() }, /* ProductURL */ \ + { 0x0000000E, ZAP_TYPE(CHAR_STRING), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_EMPTY_DEFAULT() }, /* ProductLabel */ \ + { 0x0000000F, ZAP_TYPE(CHAR_STRING), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_EMPTY_DEFAULT() }, /* SerialNumber */ \ + { 0x00000010, ZAP_TYPE(BOOLEAN), 1, \ + ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* LocalConfigDisabled */ \ { 0x00000011, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(1) }, /* Reachable */ \ { 0x00000012, ZAP_TYPE(CHAR_STRING), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(SINGLETON), \ @@ -1030,7 +1014,7 @@ { 0x00000020, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* start of week */ \ { 0x00000021, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(7) }, /* number of weekly transitions */ \ { 0x00000022, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(4) }, /* number of daily transitions */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1173) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1129) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ } @@ -1208,120 +1192,309 @@ #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask #define GENERATED_CLUSTER_COUNT 27 -#define GENERATED_CLUSTERS \ - { \ - { 0x00000003, \ - ZAP_ATTRIBUTE_INDEX(0), \ - 2, \ - 4, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayIdentifyServer }, /* Endpoint: 0, Cluster: Identify (server) */ \ - { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(2), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { \ - 0x0000001E, ZAP_ATTRIBUTE_INDEX(7), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Binding (server) */ \ - { 0x00000028, \ - ZAP_ATTRIBUTE_INDEX(8), \ - 20, \ - 39, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayBasicServer }, /* Endpoint: 0, Cluster: Basic (server) */ \ - { \ - 0x00000029, ZAP_ATTRIBUTE_INDEX(28), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ - { 0x0000002B, \ - ZAP_ATTRIBUTE_INDEX(29), \ - 3, \ - 38, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayLocalizationConfigurationServer }, /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ - { 0x0000002C, \ - ZAP_ATTRIBUTE_INDEX(32), \ - 4, \ - 4, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayTimeFormatLocalizationServer }, /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ - { 0x0000002D, \ - ZAP_ATTRIBUTE_INDEX(36), \ - 3, \ - 7, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayUnitLocalizationServer }, /* Endpoint: 0, Cluster: Unit Localization (server) */ \ - { \ - 0x00000030, ZAP_ATTRIBUTE_INDEX(36), 6, 270, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { \ - 0x00000031, ZAP_ATTRIBUTE_INDEX(42), 10, 60, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { \ - 0x00000032, ZAP_ATTRIBUTE_INDEX(55), 0, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ - { \ - 0x00000033, ZAP_ATTRIBUTE_INDEX(55), 9, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ - { \ - 0x00000034, ZAP_ATTRIBUTE_INDEX(64), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { \ - 0x00000035, ZAP_ATTRIBUTE_INDEX(70), 65, 247, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { \ - 0x00000036, ZAP_ATTRIBUTE_INDEX(135), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ - { \ - 0x00000037, ZAP_ATTRIBUTE_INDEX(150), 11, 57, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ - { \ - 0x0000003C, ZAP_ATTRIBUTE_INDEX(161), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(165), 7, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { \ - 0x0000003F, ZAP_ATTRIBUTE_INDEX(169), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Group Key Management (server) */ \ - { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(175), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ - { \ - 0x00000041, ZAP_ATTRIBUTE_INDEX(177), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: User Label (server) */ \ - { \ - 0x00000003, ZAP_ATTRIBUTE_INDEX(179), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 1, Cluster: Identify (client) */ \ - { 0x00000003, \ - ZAP_ATTRIBUTE_INDEX(180), \ - 3, \ - 5, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayIdentifyServer }, /* Endpoint: 1, Cluster: Identify (server) */ \ - { 0x00000004, \ - ZAP_ATTRIBUTE_INDEX(183), \ - 2, \ - 3, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayGroupsServer }, /* Endpoint: 1, Cluster: Groups (server) */ \ - { 0x00000005, \ - ZAP_ATTRIBUTE_INDEX(185), \ - 6, \ - 8, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayScenesServer }, /* Endpoint: 1, Cluster: Scenes (server) */ \ - { 0x00000028, \ - ZAP_ATTRIBUTE_INDEX(191), \ - 20, \ - 39, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayBasicServer }, /* Endpoint: 1, Cluster: Basic (server) */ \ - { 0x00000201, \ - ZAP_ATTRIBUTE_INDEX(211), \ - 19, \ - 34, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayThermostatServer }, /* Endpoint: 1, Cluster: Thermostat (server) */ \ - } + +// clang-format off +#define GENERATED_CLUSTERS { \ + { \ + /* Endpoint: 0, Cluster: Identify (server) */ \ + .clusterId = 0x00000003, \ + .attributes = ZAP_ATTRIBUTE_INDEX(0), \ + .attributeCount = 2, \ + .clusterSize = 4, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayIdentifyServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 0 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 3 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Descriptor (server) */ \ + .clusterId = 0x0000001D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(2), \ + .attributeCount = 5, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Binding (server) */ \ + .clusterId = 0x0000001E, \ + .attributes = ZAP_ATTRIBUTE_INDEX(7), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 5 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Basic (server) */ \ + .clusterId = 0x00000028, \ + .attributes = ZAP_ATTRIBUTE_INDEX(8), \ + .attributeCount = 20, \ + .clusterSize = 39, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayBasicServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ + .clusterId = 0x00000029, \ + .attributes = ZAP_ATTRIBUTE_INDEX(28), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 8 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 12 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ + .clusterId = 0x0000002B, \ + .attributes = ZAP_ATTRIBUTE_INDEX(29), \ + .attributeCount = 3, \ + .clusterSize = 38, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayLocalizationConfigurationServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ + .clusterId = 0x0000002C, \ + .attributes = ZAP_ATTRIBUTE_INDEX(32), \ + .attributeCount = 4, \ + .clusterSize = 4, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayTimeFormatLocalizationServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Unit Localization (server) */ \ + .clusterId = 0x0000002D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(36), \ + .attributeCount = 3, \ + .clusterSize = 7, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: General Commissioning (server) */ \ + .clusterId = 0x00000030, \ + .attributes = ZAP_ATTRIBUTE_INDEX(39), \ + .attributeCount = 6, \ + .clusterSize = 270, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 15 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 20 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ + .clusterId = 0x00000031, \ + .attributes = ZAP_ATTRIBUTE_INDEX(45), \ + .attributeCount = 10, \ + .clusterSize = 60, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 23 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 30 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ + .clusterId = 0x00000032, \ + .attributes = ZAP_ATTRIBUTE_INDEX(55), \ + .attributeCount = 0, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 33 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ + .clusterId = 0x00000033, \ + .attributes = ZAP_ATTRIBUTE_INDEX(55), \ + .attributeCount = 9, \ + .clusterSize = 17, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ + .clusterId = 0x00000034, \ + .attributes = ZAP_ATTRIBUTE_INDEX(64), \ + .attributeCount = 6, \ + .clusterSize = 30, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 35 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ + .clusterId = 0x00000035, \ + .attributes = ZAP_ATTRIBUTE_INDEX(70), \ + .attributeCount = 65, \ + .clusterSize = 247, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ + .clusterId = 0x00000036, \ + .attributes = ZAP_ATTRIBUTE_INDEX(135), \ + .attributeCount = 15, \ + .clusterSize = 58, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ + .clusterId = 0x00000037, \ + .attributes = ZAP_ATTRIBUTE_INDEX(150), \ + .attributeCount = 11, \ + .clusterSize = 57, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 37 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ + .clusterId = 0x0000003C, \ + .attributes = ZAP_ATTRIBUTE_INDEX(161), \ + .attributeCount = 4, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 39 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ + .clusterId = 0x0000003E, \ + .attributes = ZAP_ATTRIBUTE_INDEX(165), \ + .attributeCount = 7, \ + .clusterSize = 4, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 43 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 53 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Group Key Management (server) */ \ + .clusterId = 0x0000003F, \ + .attributes = ZAP_ATTRIBUTE_INDEX(172), \ + .attributeCount = 3, \ + .clusterSize = 510, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Fixed Label (server) */ \ + .clusterId = 0x00000040, \ + .attributes = ZAP_ATTRIBUTE_INDEX(175), \ + .attributeCount = 2, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: User Label (server) */ \ + .clusterId = 0x00000041, \ + .attributes = ZAP_ATTRIBUTE_INDEX(177), \ + .attributeCount = 2, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Identify (client) */ \ + .clusterId = 0x00000003, \ + .attributes = ZAP_ATTRIBUTE_INDEX(179), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 58 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 61 ) ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Identify (server) */ \ + .clusterId = 0x00000003, \ + .attributes = ZAP_ATTRIBUTE_INDEX(180), \ + .attributeCount = 3, \ + .clusterSize = 5, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayIdentifyServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 63 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 66 ) ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Groups (server) */ \ + .clusterId = 0x00000004, \ + .attributes = ZAP_ATTRIBUTE_INDEX(183), \ + .attributeCount = 2, \ + .clusterSize = 3, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayGroupsServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 68 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 75 ) ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Scenes (server) */ \ + .clusterId = 0x00000005, \ + .attributes = ZAP_ATTRIBUTE_INDEX(185), \ + .attributeCount = 6, \ + .clusterSize = 8, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayScenesServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 80 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 88 ) ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Basic (server) */ \ + .clusterId = 0x00000028, \ + .attributes = ZAP_ATTRIBUTE_INDEX(191), \ + .attributeCount = 20, \ + .clusterSize = 39, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayBasicServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Thermostat (server) */ \ + .clusterId = 0x00000201, \ + .attributes = ZAP_ATTRIBUTE_INDEX(211), \ + .attributeCount = 19, \ + .clusterSize = 34, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayThermostatServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 95 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ +} + +// clang-format on #define ZAP_CLUSTER_INDEX(index) (&generatedClusters[index]) @@ -1330,7 +1503,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 20, 1996 }, { ZAP_CLUSTER_INDEX(20), 6, 739 }, \ + { ZAP_CLUSTER_INDEX(0), 21, 1355 }, { ZAP_CLUSTER_INDEX(21), 6, 91 }, \ } // Largest attribute size is needed for various buffers @@ -1340,7 +1513,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (78) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (2735) +#define ATTRIBUTE_MAX_SIZE (1446) // 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 61c86518dec7f1..bc3c60d33e0d69 100644 --- a/zzz_generated/tv-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-app/zap-generated/endpoint_config.h @@ -42,7 +42,7 @@ /* 10 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 38 - BasicCommissioningInfoList, */ \ + /* 18 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -58,233 +58,233 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 292 - FeatureMap, */ \ + /* 272 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x06, \ \ /* Endpoint: 0, Cluster: Network Commissioning (client), big-endian */ \ \ - /* 296 - FeatureMap, */ \ + /* 276 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), big-endian */ \ \ - /* 300 - Networks, */ \ + /* 280 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 312 - LastConnectErrorValue, */ \ + /* 292 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 316 - FeatureMap, */ \ + /* 296 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), big-endian */ \ \ - /* 320 - UpTime, */ \ + /* 300 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 328 - TotalOperationalHours, */ \ + /* 308 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), big-endian */ \ \ - /* 332 - CurrentHeapFree, */ \ + /* 312 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 340 - CurrentHeapUsed, */ \ + /* 320 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 348 - CurrentHeapHighWatermark, */ \ + /* 328 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 356 - FeatureMap, */ \ + /* 336 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), big-endian */ \ \ - /* 360 - NetworkName, */ \ + /* 340 - NetworkName, */ \ 0x00, 0x00, \ \ - /* 362 - ExtendedPanId, */ \ + /* 342 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 370 - OverrunCount, */ \ + /* 350 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 378 - PartitionId, */ \ + /* 358 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 382 - TxTotalCount, */ \ + /* 362 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 386 - TxUnicastCount, */ \ + /* 366 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 390 - TxBroadcastCount, */ \ + /* 370 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 394 - TxAckRequestedCount, */ \ + /* 374 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 398 - TxAckedCount, */ \ + /* 378 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 402 - TxNoAckRequestedCount, */ \ + /* 382 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 406 - TxDataCount, */ \ + /* 386 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 410 - TxDataPollCount, */ \ + /* 390 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 414 - TxBeaconCount, */ \ + /* 394 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 418 - TxBeaconRequestCount, */ \ + /* 398 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 422 - TxOtherCount, */ \ + /* 402 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 426 - TxRetryCount, */ \ + /* 406 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 430 - TxDirectMaxRetryExpiryCount, */ \ + /* 410 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 434 - TxIndirectMaxRetryExpiryCount, */ \ + /* 414 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 438 - TxErrCcaCount, */ \ + /* 418 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 442 - TxErrAbortCount, */ \ + /* 422 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 446 - TxErrBusyChannelCount, */ \ + /* 426 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 450 - RxTotalCount, */ \ + /* 430 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 454 - RxUnicastCount, */ \ + /* 434 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 458 - RxBroadcastCount, */ \ + /* 438 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 462 - RxDataCount, */ \ + /* 442 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 466 - RxDataPollCount, */ \ + /* 446 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 470 - RxBeaconCount, */ \ + /* 450 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 474 - RxBeaconRequestCount, */ \ + /* 454 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 478 - RxOtherCount, */ \ + /* 458 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 482 - RxAddressFilteredCount, */ \ + /* 462 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 486 - RxDestAddrFilteredCount, */ \ + /* 466 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 490 - RxDuplicatedCount, */ \ + /* 470 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 494 - RxErrNoFrameCount, */ \ + /* 474 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 498 - RxErrUnknownNeighborCount, */ \ + /* 478 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 502 - RxErrInvalidSrcAddrCount, */ \ + /* 482 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 506 - RxErrSecCount, */ \ + /* 486 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 510 - RxErrFcsCount, */ \ + /* 490 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 514 - RxErrOtherCount, */ \ + /* 494 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 518 - ActiveTimestamp, */ \ + /* 498 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 526 - PendingTimestamp, */ \ + /* 506 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 534 - delay, */ \ + /* 514 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 538 - ChannelMask, */ \ + /* 518 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 545 - FeatureMap, */ \ + /* 525 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0F, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), big-endian */ \ \ - /* 549 - BeaconLostCount, */ \ + /* 529 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 553 - BeaconRxCount, */ \ + /* 533 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 557 - PacketMulticastRxCount, */ \ + /* 537 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 561 - PacketMulticastTxCount, */ \ + /* 541 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 565 - PacketUnicastRxCount, */ \ + /* 545 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 569 - PacketUnicastTxCount, */ \ + /* 549 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 573 - CurrentMaxRate, */ \ + /* 553 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 581 - OverrunCount, */ \ + /* 561 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 589 - FeatureMap, */ \ + /* 569 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), big-endian */ \ \ - /* 593 - PacketRxCount, */ \ + /* 573 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 601 - PacketTxCount, */ \ + /* 581 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 609 - TxErrCount, */ \ + /* 589 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 617 - CollisionCount, */ \ + /* 597 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 625 - OverrunCount, */ \ + /* 605 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 633 - TimeSinceReset, */ \ + /* 613 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 641 - FeatureMap, */ \ + /* 621 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ /* Endpoint: 0, Cluster: Group Key Management (server), big-endian */ \ \ - /* 645 - GroupKeyMap, */ \ + /* 625 - GroupKeyMap, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -300,7 +300,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 899 - GroupTable, */ \ + /* 879 - GroupTable, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -318,7 +318,7 @@ \ /* Endpoint: 1, Cluster: Channel (server), big-endian */ \ \ - /* 1153 - channel list, */ \ + /* 1133 - channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -336,7 +336,7 @@ \ /* Endpoint: 1, Cluster: Target Navigator (server), big-endian */ \ \ - /* 1407 - target navigator list, */ \ + /* 1387 - target navigator list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -354,7 +354,7 @@ \ /* Endpoint: 1, Cluster: Media Input (server), big-endian */ \ \ - /* 1661 - media input list, */ \ + /* 1641 - media input list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -372,7 +372,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), big-endian */ \ \ - /* 1915 - accept header list, */ \ + /* 1895 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -388,12 +388,12 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2169 - supported streaming protocols, */ \ + /* 2149 - supported streaming protocols, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Application Launcher (server), big-endian */ \ \ - /* 2173 - application launcher list, */ \ + /* 2153 - application launcher list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -411,12 +411,12 @@ \ /* Endpoint: 2, Cluster: Level Control (server), big-endian */ \ \ - /* 2427 - FeatureMap, */ \ + /* 2407 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 2, Cluster: Audio Output (server), big-endian */ \ \ - /* 2431 - audio output list, */ \ + /* 2411 - audio output list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -434,24 +434,24 @@ \ /* Endpoint: 3, Cluster: Media Playback (server), big-endian */ \ \ - /* 2685 - start time, */ \ + /* 2665 - start time, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, \ \ - /* 2693 - duration, */ \ + /* 2673 - duration, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2701 - playback speed, */ \ + /* 2681 - playback speed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2705 - seek range end, */ \ + /* 2685 - seek range end, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2713 - seek range start, */ \ + /* 2693 - seek range start, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 3, Cluster: Content Launcher (server), big-endian */ \ \ - /* 2721 - accept header list, */ \ + /* 2701 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -467,18 +467,18 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2975 - supported streaming protocols, */ \ + /* 2955 - supported streaming protocols, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 3, Cluster: Application Basic (server), big-endian */ \ \ - /* 2979 - allowed vendor list, */ \ + /* 2959 - allowed vendor list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 4, Cluster: Content Launcher (server), big-endian */ \ \ - /* 3011 - accept header list, */ \ + /* 2991 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -494,12 +494,12 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3265 - supported streaming protocols, */ \ + /* 3245 - supported streaming protocols, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 4, Cluster: Application Basic (server), big-endian */ \ \ - /* 3269 - allowed vendor list, */ \ + /* 3249 - allowed vendor list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ } @@ -523,7 +523,7 @@ /* 10 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 38 - BasicCommissioningInfoList, */ \ + /* 18 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -539,233 +539,233 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 292 - FeatureMap, */ \ + /* 272 - FeatureMap, */ \ 0x06, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Network Commissioning (client), little-endian */ \ \ - /* 296 - FeatureMap, */ \ + /* 276 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), little-endian */ \ \ - /* 300 - Networks, */ \ + /* 280 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 312 - LastConnectErrorValue, */ \ + /* 292 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 316 - FeatureMap, */ \ + /* 296 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), little-endian */ \ \ - /* 320 - UpTime, */ \ + /* 300 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 328 - TotalOperationalHours, */ \ + /* 308 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), little-endian */ \ \ - /* 332 - CurrentHeapFree, */ \ + /* 312 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 340 - CurrentHeapUsed, */ \ + /* 320 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 348 - CurrentHeapHighWatermark, */ \ + /* 328 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 356 - FeatureMap, */ \ + /* 336 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), little-endian */ \ \ - /* 360 - NetworkName, */ \ + /* 340 - NetworkName, */ \ 0x00, 0x00, \ \ - /* 362 - ExtendedPanId, */ \ + /* 342 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 370 - OverrunCount, */ \ + /* 350 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 378 - PartitionId, */ \ + /* 358 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 382 - TxTotalCount, */ \ + /* 362 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 386 - TxUnicastCount, */ \ + /* 366 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 390 - TxBroadcastCount, */ \ + /* 370 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 394 - TxAckRequestedCount, */ \ + /* 374 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 398 - TxAckedCount, */ \ + /* 378 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 402 - TxNoAckRequestedCount, */ \ + /* 382 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 406 - TxDataCount, */ \ + /* 386 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 410 - TxDataPollCount, */ \ + /* 390 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 414 - TxBeaconCount, */ \ + /* 394 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 418 - TxBeaconRequestCount, */ \ + /* 398 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 422 - TxOtherCount, */ \ + /* 402 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 426 - TxRetryCount, */ \ + /* 406 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 430 - TxDirectMaxRetryExpiryCount, */ \ + /* 410 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 434 - TxIndirectMaxRetryExpiryCount, */ \ + /* 414 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 438 - TxErrCcaCount, */ \ + /* 418 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 442 - TxErrAbortCount, */ \ + /* 422 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 446 - TxErrBusyChannelCount, */ \ + /* 426 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 450 - RxTotalCount, */ \ + /* 430 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 454 - RxUnicastCount, */ \ + /* 434 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 458 - RxBroadcastCount, */ \ + /* 438 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 462 - RxDataCount, */ \ + /* 442 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 466 - RxDataPollCount, */ \ + /* 446 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 470 - RxBeaconCount, */ \ + /* 450 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 474 - RxBeaconRequestCount, */ \ + /* 454 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 478 - RxOtherCount, */ \ + /* 458 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 482 - RxAddressFilteredCount, */ \ + /* 462 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 486 - RxDestAddrFilteredCount, */ \ + /* 466 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 490 - RxDuplicatedCount, */ \ + /* 470 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 494 - RxErrNoFrameCount, */ \ + /* 474 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 498 - RxErrUnknownNeighborCount, */ \ + /* 478 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 502 - RxErrInvalidSrcAddrCount, */ \ + /* 482 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 506 - RxErrSecCount, */ \ + /* 486 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 510 - RxErrFcsCount, */ \ + /* 490 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 514 - RxErrOtherCount, */ \ + /* 494 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 518 - ActiveTimestamp, */ \ + /* 498 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 526 - PendingTimestamp, */ \ + /* 506 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 534 - delay, */ \ + /* 514 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 538 - ChannelMask, */ \ + /* 518 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 545 - FeatureMap, */ \ + /* 525 - FeatureMap, */ \ 0x0F, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), little-endian */ \ \ - /* 549 - BeaconLostCount, */ \ + /* 529 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 553 - BeaconRxCount, */ \ + /* 533 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 557 - PacketMulticastRxCount, */ \ + /* 537 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 561 - PacketMulticastTxCount, */ \ + /* 541 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 565 - PacketUnicastRxCount, */ \ + /* 545 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 569 - PacketUnicastTxCount, */ \ + /* 549 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 573 - CurrentMaxRate, */ \ + /* 553 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 581 - OverrunCount, */ \ + /* 561 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 589 - FeatureMap, */ \ + /* 569 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), little-endian */ \ \ - /* 593 - PacketRxCount, */ \ + /* 573 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 601 - PacketTxCount, */ \ + /* 581 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 609 - TxErrCount, */ \ + /* 589 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 617 - CollisionCount, */ \ + /* 597 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 625 - OverrunCount, */ \ + /* 605 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 633 - TimeSinceReset, */ \ + /* 613 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 641 - FeatureMap, */ \ + /* 621 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Group Key Management (server), little-endian */ \ \ - /* 645 - GroupKeyMap, */ \ + /* 625 - GroupKeyMap, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -781,7 +781,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 899 - GroupTable, */ \ + /* 879 - GroupTable, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -799,7 +799,7 @@ \ /* Endpoint: 1, Cluster: Channel (server), little-endian */ \ \ - /* 1153 - channel list, */ \ + /* 1133 - channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -817,7 +817,7 @@ \ /* Endpoint: 1, Cluster: Target Navigator (server), little-endian */ \ \ - /* 1407 - target navigator list, */ \ + /* 1387 - target navigator list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -835,7 +835,7 @@ \ /* Endpoint: 1, Cluster: Media Input (server), little-endian */ \ \ - /* 1661 - media input list, */ \ + /* 1641 - media input list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -853,7 +853,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), little-endian */ \ \ - /* 1915 - accept header list, */ \ + /* 1895 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -869,12 +869,12 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2169 - supported streaming protocols, */ \ + /* 2149 - supported streaming protocols, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Application Launcher (server), little-endian */ \ \ - /* 2173 - application launcher list, */ \ + /* 2153 - application launcher list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -892,12 +892,12 @@ \ /* Endpoint: 2, Cluster: Level Control (server), little-endian */ \ \ - /* 2427 - FeatureMap, */ \ + /* 2407 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 2, Cluster: Audio Output (server), little-endian */ \ \ - /* 2431 - audio output list, */ \ + /* 2411 - audio output list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -915,24 +915,24 @@ \ /* Endpoint: 3, Cluster: Media Playback (server), little-endian */ \ \ - /* 2685 - start time, */ \ + /* 2665 - start time, */ \ 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2693 - duration, */ \ + /* 2673 - duration, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2701 - playback speed, */ \ + /* 2681 - playback speed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2705 - seek range end, */ \ + /* 2685 - seek range end, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2713 - seek range start, */ \ + /* 2693 - seek range start, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 3, Cluster: Content Launcher (server), little-endian */ \ \ - /* 2721 - accept header list, */ \ + /* 2701 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -948,18 +948,18 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2975 - supported streaming protocols, */ \ + /* 2955 - supported streaming protocols, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 3, Cluster: Application Basic (server), little-endian */ \ \ - /* 2979 - allowed vendor list, */ \ + /* 2959 - allowed vendor list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 4, Cluster: Content Launcher (server), little-endian */ \ \ - /* 3011 - accept header list, */ \ + /* 2991 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -975,19 +975,19 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3265 - supported streaming protocols, */ \ + /* 3245 - supported streaming protocols, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 4, Cluster: Application Basic (server), little-endian */ \ \ - /* 3269 - allowed vendor list, */ \ + /* 3249 - allowed vendor list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ } #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (97) +#define GENERATED_DEFAULTS_COUNT (95) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -1025,12 +1025,11 @@ { \ \ /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Binding (server) */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ @@ -1111,34 +1110,34 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x00000000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(30) }, /* Breadcrumb */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(38) }, /* BasicCommissioningInfoList */ \ + { 0x00000000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(10) }, /* Breadcrumb */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(18) }, /* BasicCommissioningInfoList */ \ { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* RegulatoryConfig */ \ { 0x00000003, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* LocationCapability */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(292) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(272) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Network Commissioning (client) */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_LONG_DEFAULTS_INDEX(296) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_LONG_DEFAULTS_INDEX(276) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* MaxNetworks */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(300) }, /* Networks */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(280) }, /* Networks */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ScanMaxTimeSeconds */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ConnectMaxTimeSeconds */ \ { 0x00000004, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* InterfaceEnabled */ \ { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkingStatus */ \ { 0x00000006, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkID */ \ - { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(312) }, /* LastConnectErrorValue */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(316) }, /* FeatureMap */ \ + { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(292) }, /* LastConnectErrorValue */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(296) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NetworkInterfaces */ \ { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* RebootCount */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(320) }, /* UpTime */ \ - { 0x00000003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(328) }, /* TotalOperationalHours */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(300) }, /* UpTime */ \ + { 0x00000003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(308) }, /* TotalOperationalHours */ \ { 0x00000004, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BootReasons */ \ { 0x00000005, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* ActiveHardwareFaults */ \ @@ -1149,23 +1148,23 @@ \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ThreadMetrics */ \ - { 0x00000001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(332) }, /* CurrentHeapFree */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(340) }, /* CurrentHeapUsed */ \ - { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(348) }, /* CurrentHeapHighWatermark */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(356) }, /* FeatureMap */ \ + { 0x00000001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(312) }, /* CurrentHeapFree */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(320) }, /* CurrentHeapUsed */ \ + { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(328) }, /* CurrentHeapHighWatermark */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(336) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x00000001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ - { 0x00000002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(360) }, /* NetworkName */ \ + { 0x00000002, ZAP_TYPE(CHAR_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(340) }, /* NetworkName */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ - { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(362) }, /* ExtendedPanId */ \ + { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(342) }, /* ExtendedPanId */ \ { 0x00000005, ZAP_TYPE(OCTET_STRING), 18, 0, ZAP_EMPTY_DEFAULT() }, /* MeshLocalPrefix */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(370) }, /* OverrunCount */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(350) }, /* OverrunCount */ \ { 0x00000007, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NeighborTableList */ \ { 0x00000008, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* RouteTableList */ \ - { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(378) }, /* PartitionId */ \ + { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(358) }, /* PartitionId */ \ { 0x0000000A, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* weighting */ \ { 0x0000000B, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* DataVersion */ \ { 0x0000000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* StableDataVersion */ \ @@ -1178,50 +1177,50 @@ { 0x00000013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PartitionIdChangeCount */ \ { 0x00000014, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* BetterPartitionAttachAttemptCount */ \ { 0x00000015, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ParentChangeCount */ \ - { 0x00000016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(382) }, /* TxTotalCount */ \ - { 0x00000017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(386) }, /* TxUnicastCount */ \ - { 0x00000018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(390) }, /* TxBroadcastCount */ \ - { 0x00000019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(394) }, /* TxAckRequestedCount */ \ - { 0x0000001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(398) }, /* TxAckedCount */ \ - { 0x0000001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(402) }, /* TxNoAckRequestedCount */ \ - { 0x0000001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(406) }, /* TxDataCount */ \ - { 0x0000001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(410) }, /* TxDataPollCount */ \ - { 0x0000001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(414) }, /* TxBeaconCount */ \ - { 0x0000001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(418) }, /* TxBeaconRequestCount */ \ - { 0x00000020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(422) }, /* TxOtherCount */ \ - { 0x00000021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(426) }, /* TxRetryCount */ \ - { 0x00000022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(430) }, /* TxDirectMaxRetryExpiryCount */ \ - { 0x00000023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(434) }, /* TxIndirectMaxRetryExpiryCount */ \ - { 0x00000024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(438) }, /* TxErrCcaCount */ \ - { 0x00000025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(442) }, /* TxErrAbortCount */ \ - { 0x00000026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(446) }, /* TxErrBusyChannelCount */ \ - { 0x00000027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(450) }, /* RxTotalCount */ \ - { 0x00000028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(454) }, /* RxUnicastCount */ \ - { 0x00000029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(458) }, /* RxBroadcastCount */ \ - { 0x0000002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(462) }, /* RxDataCount */ \ - { 0x0000002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(466) }, /* RxDataPollCount */ \ - { 0x0000002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(470) }, /* RxBeaconCount */ \ - { 0x0000002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(474) }, /* RxBeaconRequestCount */ \ - { 0x0000002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(478) }, /* RxOtherCount */ \ - { 0x0000002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(482) }, /* RxAddressFilteredCount */ \ - { 0x00000030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(486) }, /* RxDestAddrFilteredCount */ \ - { 0x00000031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(490) }, /* RxDuplicatedCount */ \ - { 0x00000032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(494) }, /* RxErrNoFrameCount */ \ - { 0x00000033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(498) }, /* RxErrUnknownNeighborCount */ \ - { 0x00000034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(502) }, /* RxErrInvalidSrcAddrCount */ \ - { 0x00000035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(506) }, /* RxErrSecCount */ \ - { 0x00000036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(510) }, /* RxErrFcsCount */ \ - { 0x00000037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(514) }, /* RxErrOtherCount */ \ - { 0x00000038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(518) }, /* ActiveTimestamp */ \ - { 0x00000039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(526) }, /* PendingTimestamp */ \ - { 0x0000003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(534) }, /* delay */ \ + { 0x00000016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(362) }, /* TxTotalCount */ \ + { 0x00000017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(366) }, /* TxUnicastCount */ \ + { 0x00000018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(370) }, /* TxBroadcastCount */ \ + { 0x00000019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(374) }, /* TxAckRequestedCount */ \ + { 0x0000001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(378) }, /* TxAckedCount */ \ + { 0x0000001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(382) }, /* TxNoAckRequestedCount */ \ + { 0x0000001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(386) }, /* TxDataCount */ \ + { 0x0000001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(390) }, /* TxDataPollCount */ \ + { 0x0000001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(394) }, /* TxBeaconCount */ \ + { 0x0000001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(398) }, /* TxBeaconRequestCount */ \ + { 0x00000020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(402) }, /* TxOtherCount */ \ + { 0x00000021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(406) }, /* TxRetryCount */ \ + { 0x00000022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(410) }, /* TxDirectMaxRetryExpiryCount */ \ + { 0x00000023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(414) }, /* TxIndirectMaxRetryExpiryCount */ \ + { 0x00000024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(418) }, /* TxErrCcaCount */ \ + { 0x00000025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(422) }, /* TxErrAbortCount */ \ + { 0x00000026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(426) }, /* TxErrBusyChannelCount */ \ + { 0x00000027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(430) }, /* RxTotalCount */ \ + { 0x00000028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(434) }, /* RxUnicastCount */ \ + { 0x00000029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(438) }, /* RxBroadcastCount */ \ + { 0x0000002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(442) }, /* RxDataCount */ \ + { 0x0000002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(446) }, /* RxDataPollCount */ \ + { 0x0000002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(450) }, /* RxBeaconCount */ \ + { 0x0000002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(454) }, /* RxBeaconRequestCount */ \ + { 0x0000002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(458) }, /* RxOtherCount */ \ + { 0x0000002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(462) }, /* RxAddressFilteredCount */ \ + { 0x00000030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(466) }, /* RxDestAddrFilteredCount */ \ + { 0x00000031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(470) }, /* RxDuplicatedCount */ \ + { 0x00000032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(474) }, /* RxErrNoFrameCount */ \ + { 0x00000033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(478) }, /* RxErrUnknownNeighborCount */ \ + { 0x00000034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(482) }, /* RxErrInvalidSrcAddrCount */ \ + { 0x00000035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(486) }, /* RxErrSecCount */ \ + { 0x00000036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(490) }, /* RxErrFcsCount */ \ + { 0x00000037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(494) }, /* RxErrOtherCount */ \ + { 0x00000038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(498) }, /* ActiveTimestamp */ \ + { 0x00000039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(506) }, /* PendingTimestamp */ \ + { 0x0000003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(514) }, /* delay */ \ { 0x0000003B, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SecurityPolicy */ \ - { 0x0000003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(538) }, /* ChannelMask */ \ + { 0x0000003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(518) }, /* ChannelMask */ \ { 0x0000003D, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* OperationalDatasetComponents */ \ { 0x0000003E, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* ActiveNetworkFaultsList */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(545) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(525) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ @@ -1230,36 +1229,36 @@ { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* WiFiVersion */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChannelNumber */ \ { 0x00000004, ZAP_TYPE(INT8S), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Rssi */ \ - { 0x00000005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(549) }, /* BeaconLostCount */ \ - { 0x00000006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(553) }, /* BeaconRxCount */ \ - { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(557) }, /* PacketMulticastRxCount */ \ - { 0x00000008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(561) }, /* PacketMulticastTxCount */ \ - { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(565) }, /* PacketUnicastRxCount */ \ - { 0x0000000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(569) }, /* PacketUnicastTxCount */ \ - { 0x0000000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(573) }, /* CurrentMaxRate */ \ - { 0x0000000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(581) }, /* OverrunCount */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(589) }, /* FeatureMap */ \ + { 0x00000005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(529) }, /* BeaconLostCount */ \ + { 0x00000006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(533) }, /* BeaconRxCount */ \ + { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(537) }, /* PacketMulticastRxCount */ \ + { 0x00000008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(541) }, /* PacketMulticastTxCount */ \ + { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(545) }, /* PacketUnicastRxCount */ \ + { 0x0000000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(549) }, /* PacketUnicastTxCount */ \ + { 0x0000000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(553) }, /* CurrentMaxRate */ \ + { 0x0000000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(561) }, /* OverrunCount */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(569) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* PHYRate */ \ { 0x00000001, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* FullDuplex */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(593) }, /* PacketRxCount */ \ - { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(601) }, /* PacketTxCount */ \ - { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(609) }, /* TxErrCount */ \ - { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(617) }, /* CollisionCount */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(625) }, /* OverrunCount */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(573) }, /* PacketRxCount */ \ + { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(581) }, /* PacketTxCount */ \ + { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(589) }, /* TxErrCount */ \ + { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(597) }, /* CollisionCount */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(605) }, /* OverrunCount */ \ { 0x00000007, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* CarrierDetect */ \ - { 0x00000008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(633) }, /* TimeSinceReset */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(641) }, /* FeatureMap */ \ + { 0x00000008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(613) }, /* TimeSinceReset */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(621) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { 0x00000000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* WindowStatus */ \ + { 0x00000000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ { 0x00000001, ZAP_TYPE(FABRIC_IDX), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* AdminVendorId */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ @@ -1273,8 +1272,8 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(645) }, /* GroupKeyMap */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(899) }, /* GroupTable */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(625) }, /* GroupKeyMap */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(879) }, /* GroupTable */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ @@ -1297,19 +1296,18 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ { 0x00000000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* wake on lan mac address */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Channel (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1153) }, /* channel list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1133) }, /* channel list */ \ { 0x00000001, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* channel lineup */ \ { 0x00000002, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -1317,12 +1315,12 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Target Navigator (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1407) }, /* target navigator list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1387) }, /* target navigator list */ \ { 0x00000001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* current navigator target */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Media Input (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1661) }, /* media input list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1641) }, /* media input list */ \ { 0x00000001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current media input */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ @@ -1333,15 +1331,15 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Content Launcher (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1915) }, /* accept header list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1895) }, /* accept header list */ \ { 0x00000001, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(2169) }, /* supported streaming protocols */ \ + ZAP_LONG_DEFAULTS_INDEX(2149) }, /* supported streaming protocols */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Application Launcher (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2173) }, /* application launcher list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2153) }, /* application launcher list */ \ { 0x00000001, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_SIMPLE_DEFAULT(0x00) }, /* application launcher app */ \ + ZAP_EMPTY_DEFAULT() }, /* application launcher app */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 2, Cluster: On/Off (server) */ \ @@ -1371,45 +1369,43 @@ { 0x00004000, ZAP_TYPE(INT8U), 1, \ ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(255) }, /* start up current level */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(2427) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(2407) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 2, Cluster: Audio Output (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2431) }, /* audio output list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2411) }, /* audio output list */ \ { 0x00000001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current audio output */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 3, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 3, Cluster: Media Playback (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* playback state */ \ - { 0x00000001, ZAP_TYPE(EPOCH_US), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2685) }, /* start time */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2693) }, /* duration */ \ + { 0x00000001, ZAP_TYPE(EPOCH_US), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2665) }, /* start time */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2673) }, /* duration */ \ { 0x00000003, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* position */ \ - { 0x00000004, ZAP_TYPE(SINGLE), 4, 0, ZAP_LONG_DEFAULTS_INDEX(2701) }, /* playback speed */ \ - { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2705) }, /* seek range end */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2713) }, /* seek range start */ \ + { 0x00000004, ZAP_TYPE(SINGLE), 4, 0, ZAP_LONG_DEFAULTS_INDEX(2681) }, /* playback speed */ \ + { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2685) }, /* seek range end */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2693) }, /* seek range start */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 3, Cluster: Content Launcher (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2721) }, /* accept header list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2701) }, /* accept header list */ \ { 0x00000001, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(2975) }, /* supported streaming protocols */ \ + ZAP_LONG_DEFAULTS_INDEX(2955) }, /* supported streaming protocols */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 3, Cluster: Application Basic (server) */ \ @@ -1421,24 +1417,23 @@ ZAP_EMPTY_DEFAULT() }, /* application app */ \ { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* application status */ \ { 0x00000006, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application version */ \ - { 0x00000007, ZAP_TYPE(ARRAY), 32, 0, ZAP_LONG_DEFAULTS_INDEX(2979) }, /* allowed vendor list */ \ + { 0x00000007, ZAP_TYPE(ARRAY), 32, 0, ZAP_LONG_DEFAULTS_INDEX(2959) }, /* allowed vendor list */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 3, Cluster: Account Login (server) */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 4, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 4, Cluster: Content Launcher (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3011) }, /* accept header list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2991) }, /* accept header list */ \ { 0x00000001, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3265) }, /* supported streaming protocols */ \ + ZAP_LONG_DEFAULTS_INDEX(3245) }, /* supported streaming protocols */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 4, Cluster: Application Basic (server) */ \ @@ -1450,16 +1445,15 @@ ZAP_EMPTY_DEFAULT() }, /* application app */ \ { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* application status */ \ { 0x00000006, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application version */ \ - { 0x00000007, ZAP_TYPE(ARRAY), 32, 0, ZAP_LONG_DEFAULTS_INDEX(3269) }, /* allowed vendor list */ \ + { 0x00000007, ZAP_TYPE(ARRAY), 32, 0, ZAP_LONG_DEFAULTS_INDEX(3249) }, /* allowed vendor list */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 5, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 5, Cluster: Application Basic (server) */ \ { 0x00000000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* vendor name */ \ @@ -1467,7 +1461,7 @@ { 0x00000002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application name */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* product id */ \ { 0x00000004, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_SIMPLE_DEFAULT(0x00) }, /* application app */ \ + ZAP_EMPTY_DEFAULT() }, /* application app */ \ { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* application status */ \ { 0x00000006, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application version */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ @@ -1700,177 +1694,551 @@ #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask #define GENERATED_CLUSTER_COUNT 49 -#define GENERATED_CLUSTERS \ - { \ - { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(0), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { \ - 0x0000001E, ZAP_ATTRIBUTE_INDEX(5), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 0, Cluster: Binding (client) */ \ - { \ - 0x0000001E, ZAP_ATTRIBUTE_INDEX(6), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Binding (server) */ \ - { 0x00000028, \ - ZAP_ATTRIBUTE_INDEX(7), \ - 20, \ - 39, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayBasicServer }, /* Endpoint: 0, Cluster: Basic (server) */ \ - { \ - 0x00000029, ZAP_ATTRIBUTE_INDEX(27), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ - { 0x0000002B, \ - ZAP_ATTRIBUTE_INDEX(28), \ - 3, \ - 38, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayLocalizationConfigurationServer }, /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ - { 0x0000002C, \ - ZAP_ATTRIBUTE_INDEX(31), \ - 4, \ - 4, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayTimeFormatLocalizationServer }, /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ - { 0x0000002D, \ - ZAP_ATTRIBUTE_INDEX(35), \ - 3, \ - 7, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayUnitLocalizationServer }, /* Endpoint: 0, Cluster: Unit Localization (server) */ \ - { \ - 0x00000030, ZAP_ATTRIBUTE_INDEX(38), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 0, Cluster: General Commissioning (client) */ \ - { \ - 0x00000030, ZAP_ATTRIBUTE_INDEX(36), 6, 270, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { \ - 0x00000031, ZAP_ATTRIBUTE_INDEX(45), 2, 6, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 0, Cluster: Network Commissioning (client) */ \ - { \ - 0x00000031, ZAP_ATTRIBUTE_INDEX(44), 10, 60, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { \ - 0x00000032, ZAP_ATTRIBUTE_INDEX(57), 0, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ - { \ - 0x00000033, ZAP_ATTRIBUTE_INDEX(57), 9, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ - { \ - 0x00000034, ZAP_ATTRIBUTE_INDEX(66), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { \ - 0x00000035, ZAP_ATTRIBUTE_INDEX(72), 65, 247, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { \ - 0x00000036, ZAP_ATTRIBUTE_INDEX(137), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ - { \ - 0x00000037, ZAP_ATTRIBUTE_INDEX(152), 11, 57, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ - { \ - 0x0000003C, ZAP_ATTRIBUTE_INDEX(163), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(167), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 0, Cluster: Operational Credentials (client) */ \ - { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(168), 7, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { \ - 0x0000003F, ZAP_ATTRIBUTE_INDEX(172), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Group Key Management (server) */ \ - { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(178), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ - { \ - 0x00000041, ZAP_ATTRIBUTE_INDEX(180), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: User Label (server) */ \ - { \ - 0x00000405, ZAP_ATTRIBUTE_INDEX(182), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ - { 0x00000006, \ - ZAP_ATTRIBUTE_INDEX(186), \ - 2, \ - 3, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ - { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(188), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ - { \ - 0x00000503, ZAP_ATTRIBUTE_INDEX(193), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ - { \ - 0x00000504, ZAP_ATTRIBUTE_INDEX(192), 4, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Channel (server) */ \ - { \ - 0x00000505, ZAP_ATTRIBUTE_INDEX(196), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Target Navigator (server) */ \ - { \ - 0x00000507, ZAP_ATTRIBUTE_INDEX(199), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Media Input (server) */ \ - { \ - 0x00000508, ZAP_ATTRIBUTE_INDEX(205), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Low Power (server) */ \ - { \ - 0x00000509, ZAP_ATTRIBUTE_INDEX(206), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Keypad Input (server) */ \ - { \ - 0x0000050A, ZAP_ATTRIBUTE_INDEX(204), 3, 260, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Content Launcher (server) */ \ - { \ - 0x0000050C, ZAP_ATTRIBUTE_INDEX(207), 3, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Application Launcher (server) */ \ - { 0x00000006, \ - ZAP_ATTRIBUTE_INDEX(213), \ - 2, \ - 3, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/Off (server) */ \ - { 0x00000008, \ - ZAP_ATTRIBUTE_INDEX(215), \ - 16, \ - 27, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayLevelControlServer }, /* Endpoint: 2, Cluster: Level Control (server) */ \ - { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(231), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 2, Cluster: Descriptor (server) */ \ - { \ - 0x0000050B, ZAP_ATTRIBUTE_INDEX(233), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 2, Cluster: Audio Output (server) */ \ - { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(239), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 3, Cluster: Descriptor (server) */ \ - { \ - 0x00000506, ZAP_ATTRIBUTE_INDEX(244), 8, 39, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 3, Cluster: Media Playback (server) */ \ - { \ - 0x0000050A, ZAP_ATTRIBUTE_INDEX(249), 3, 260, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 3, Cluster: Content Launcher (server) */ \ - { \ - 0x0000050D, ZAP_ATTRIBUTE_INDEX(252), 9, 138, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 3, Cluster: Application Basic (server) */ \ - { \ - 0x0000050E, ZAP_ATTRIBUTE_INDEX(264), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 3, Cluster: Account Login (server) */ \ - { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(265), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 4, Cluster: Descriptor (server) */ \ - { \ - 0x0000050A, ZAP_ATTRIBUTE_INDEX(267), 3, 260, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 4, Cluster: Content Launcher (server) */ \ - { \ - 0x0000050D, ZAP_ATTRIBUTE_INDEX(270), 9, 138, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 4, Cluster: Application Basic (server) */ \ - { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(282), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 5, Cluster: Descriptor (server) */ \ - { \ - 0x0000050D, ZAP_ATTRIBUTE_INDEX(287), 8, 106, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 5, Cluster: Application Basic (server) */ \ - } + +// clang-format off +#define GENERATED_CLUSTERS { \ + { \ + /* Endpoint: 0, Cluster: Descriptor (server) */ \ + .clusterId = 0x0000001D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(0), \ + .attributeCount = 5, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Binding (client) */ \ + .clusterId = 0x0000001E, \ + .attributes = ZAP_ATTRIBUTE_INDEX(5), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 0 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Binding (server) */ \ + .clusterId = 0x0000001E, \ + .attributes = ZAP_ATTRIBUTE_INDEX(6), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 3 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Basic (server) */ \ + .clusterId = 0x00000028, \ + .attributes = ZAP_ATTRIBUTE_INDEX(7), \ + .attributeCount = 20, \ + .clusterSize = 39, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayBasicServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ + .clusterId = 0x00000029, \ + .attributes = ZAP_ATTRIBUTE_INDEX(27), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 6 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 10 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ + .clusterId = 0x0000002B, \ + .attributes = ZAP_ATTRIBUTE_INDEX(28), \ + .attributeCount = 3, \ + .clusterSize = 38, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayLocalizationConfigurationServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ + .clusterId = 0x0000002C, \ + .attributes = ZAP_ATTRIBUTE_INDEX(31), \ + .attributeCount = 4, \ + .clusterSize = 4, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayTimeFormatLocalizationServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Unit Localization (server) */ \ + .clusterId = 0x0000002D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(35), \ + .attributeCount = 3, \ + .clusterSize = 7, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: General Commissioning (client) */ \ + .clusterId = 0x00000030, \ + .attributes = ZAP_ATTRIBUTE_INDEX(38), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 13 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 16 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: General Commissioning (server) */ \ + .clusterId = 0x00000030, \ + .attributes = ZAP_ATTRIBUTE_INDEX(39), \ + .attributeCount = 6, \ + .clusterSize = 270, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 21 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 26 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Network Commissioning (client) */ \ + .clusterId = 0x00000031, \ + .attributes = ZAP_ATTRIBUTE_INDEX(45), \ + .attributeCount = 2, \ + .clusterSize = 6, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 29 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 34 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ + .clusterId = 0x00000031, \ + .attributes = ZAP_ATTRIBUTE_INDEX(47), \ + .attributeCount = 10, \ + .clusterSize = 60, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 40 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 48 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ + .clusterId = 0x00000032, \ + .attributes = ZAP_ATTRIBUTE_INDEX(57), \ + .attributeCount = 0, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 51 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ + .clusterId = 0x00000033, \ + .attributes = ZAP_ATTRIBUTE_INDEX(57), \ + .attributeCount = 9, \ + .clusterSize = 17, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ + .clusterId = 0x00000034, \ + .attributes = ZAP_ATTRIBUTE_INDEX(66), \ + .attributeCount = 6, \ + .clusterSize = 30, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 53 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ + .clusterId = 0x00000035, \ + .attributes = ZAP_ATTRIBUTE_INDEX(72), \ + .attributeCount = 65, \ + .clusterSize = 247, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ + .clusterId = 0x00000036, \ + .attributes = ZAP_ATTRIBUTE_INDEX(137), \ + .attributeCount = 15, \ + .clusterSize = 58, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ + .clusterId = 0x00000037, \ + .attributes = ZAP_ATTRIBUTE_INDEX(152), \ + .attributeCount = 11, \ + .clusterSize = 57, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 55 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ + .clusterId = 0x0000003C, \ + .attributes = ZAP_ATTRIBUTE_INDEX(163), \ + .attributeCount = 4, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 57 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Operational Credentials (client) */ \ + .clusterId = 0x0000003E, \ + .attributes = ZAP_ATTRIBUTE_INDEX(167), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 61 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 71 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ + .clusterId = 0x0000003E, \ + .attributes = ZAP_ATTRIBUTE_INDEX(168), \ + .attributeCount = 7, \ + .clusterSize = 4, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 76 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 86 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Group Key Management (server) */ \ + .clusterId = 0x0000003F, \ + .attributes = ZAP_ATTRIBUTE_INDEX(175), \ + .attributeCount = 3, \ + .clusterSize = 510, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Fixed Label (server) */ \ + .clusterId = 0x00000040, \ + .attributes = ZAP_ATTRIBUTE_INDEX(178), \ + .attributeCount = 2, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: User Label (server) */ \ + .clusterId = 0x00000041, \ + .attributes = ZAP_ATTRIBUTE_INDEX(180), \ + .attributeCount = 2, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ + .clusterId = 0x00000405, \ + .attributes = ZAP_ATTRIBUTE_INDEX(182), \ + .attributeCount = 4, \ + .clusterSize = 8, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: On/Off (server) */ \ + .clusterId = 0x00000006, \ + .attributes = ZAP_ATTRIBUTE_INDEX(186), \ + .attributeCount = 2, \ + .clusterSize = 3, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayOnOffServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 91 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Descriptor (server) */ \ + .clusterId = 0x0000001D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(188), \ + .attributeCount = 5, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ + .clusterId = 0x00000503, \ + .attributes = ZAP_ATTRIBUTE_INDEX(193), \ + .attributeCount = 2, \ + .clusterSize = 35, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Channel (server) */ \ + .clusterId = 0x00000504, \ + .attributes = ZAP_ATTRIBUTE_INDEX(195), \ + .attributeCount = 4, \ + .clusterSize = 256, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 95 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 99 ) ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Target Navigator (server) */ \ + .clusterId = 0x00000505, \ + .attributes = ZAP_ATTRIBUTE_INDEX(199), \ + .attributeCount = 3, \ + .clusterSize = 257, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 101 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 103 ) ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Media Input (server) */ \ + .clusterId = 0x00000507, \ + .attributes = ZAP_ATTRIBUTE_INDEX(202), \ + .attributeCount = 3, \ + .clusterSize = 257, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 105 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Low Power (server) */ \ + .clusterId = 0x00000508, \ + .attributes = ZAP_ATTRIBUTE_INDEX(205), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 110 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Keypad Input (server) */ \ + .clusterId = 0x00000509, \ + .attributes = ZAP_ATTRIBUTE_INDEX(206), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 112 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Content Launcher (server) */ \ + .clusterId = 0x0000050A, \ + .attributes = ZAP_ATTRIBUTE_INDEX(207), \ + .attributeCount = 3, \ + .clusterSize = 260, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 114 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 117 ) ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Application Launcher (server) */ \ + .clusterId = 0x0000050C, \ + .attributes = ZAP_ATTRIBUTE_INDEX(210), \ + .attributeCount = 3, \ + .clusterSize = 256, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 119 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 123 ) ,\ + },\ + { \ + /* Endpoint: 2, Cluster: On/Off (server) */ \ + .clusterId = 0x00000006, \ + .attributes = ZAP_ATTRIBUTE_INDEX(213), \ + .attributeCount = 2, \ + .clusterSize = 3, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayOnOffServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 125 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 2, Cluster: Level Control (server) */ \ + .clusterId = 0x00000008, \ + .attributes = ZAP_ATTRIBUTE_INDEX(215), \ + .attributeCount = 16, \ + .clusterSize = 27, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayLevelControlServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 129 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 2, Cluster: Descriptor (server) */ \ + .clusterId = 0x0000001D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(231), \ + .attributeCount = 5, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 2, Cluster: Audio Output (server) */ \ + .clusterId = 0x0000050B, \ + .attributes = ZAP_ATTRIBUTE_INDEX(236), \ + .attributeCount = 3, \ + .clusterSize = 257, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 138 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 3, Cluster: Descriptor (server) */ \ + .clusterId = 0x0000001D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(239), \ + .attributeCount = 5, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 3, Cluster: Media Playback (server) */ \ + .clusterId = 0x00000506, \ + .attributes = ZAP_ATTRIBUTE_INDEX(244), \ + .attributeCount = 8, \ + .clusterSize = 39, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 141 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 153 ) ,\ + },\ + { \ + /* Endpoint: 3, Cluster: Content Launcher (server) */ \ + .clusterId = 0x0000050A, \ + .attributes = ZAP_ATTRIBUTE_INDEX(252), \ + .attributeCount = 3, \ + .clusterSize = 260, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 155 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 158 ) ,\ + },\ + { \ + /* Endpoint: 3, Cluster: Application Basic (server) */ \ + .clusterId = 0x0000050D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(255), \ + .attributeCount = 9, \ + .clusterSize = 138, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 3, Cluster: Account Login (server) */ \ + .clusterId = 0x0000050E, \ + .attributes = ZAP_ATTRIBUTE_INDEX(264), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 160 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 164 ) ,\ + },\ + { \ + /* Endpoint: 4, Cluster: Descriptor (server) */ \ + .clusterId = 0x0000001D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(265), \ + .attributeCount = 5, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 4, Cluster: Content Launcher (server) */ \ + .clusterId = 0x0000050A, \ + .attributes = ZAP_ATTRIBUTE_INDEX(270), \ + .attributeCount = 3, \ + .clusterSize = 260, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 166 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 169 ) ,\ + },\ + { \ + /* Endpoint: 4, Cluster: Application Basic (server) */ \ + .clusterId = 0x0000050D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(273), \ + .attributeCount = 9, \ + .clusterSize = 138, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 5, Cluster: Descriptor (server) */ \ + .clusterId = 0x0000001D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(282), \ + .attributeCount = 5, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 5, Cluster: Application Basic (server) */ \ + .clusterId = 0x0000050D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(287), \ + .attributeCount = 8, \ + .clusterSize = 106, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ +} + +// clang-format on #define ZAP_CLUSTER_INDEX(index) (&generatedClusters[index]) @@ -1879,8 +2247,8 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 24, 2012 }, { ZAP_CLUSTER_INDEX(24), 10, 1328 }, { ZAP_CLUSTER_INDEX(34), 4, 287 }, \ - { ZAP_CLUSTER_INDEX(38), 5, 439 }, { ZAP_CLUSTER_INDEX(43), 3, 398 }, { ZAP_CLUSTER_INDEX(46), 2, 106 }, \ + { ZAP_CLUSTER_INDEX(0), 25, 1371 }, { ZAP_CLUSTER_INDEX(25), 10, 1328 }, { ZAP_CLUSTER_INDEX(35), 4, 287 }, \ + { ZAP_CLUSTER_INDEX(39), 5, 439 }, { ZAP_CLUSTER_INDEX(44), 3, 398 }, { ZAP_CLUSTER_INDEX(47), 2, 106 }, \ } // Largest attribute size is needed for various buffers @@ -1890,7 +2258,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (39) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (4570) +#define ATTRIBUTE_MAX_SIZE (3929) // 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 11562e83641d12..e0f588e803a06c 100644 --- a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h @@ -42,7 +42,7 @@ /* 10 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 38 - BasicCommissioningInfoList, */ \ + /* 18 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -58,228 +58,228 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 292 - FeatureMap, */ \ + /* 272 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x06, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), big-endian */ \ \ - /* 296 - Networks, */ \ + /* 276 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 308 - LastConnectErrorValue, */ \ + /* 288 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 312 - FeatureMap, */ \ + /* 292 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), big-endian */ \ \ - /* 316 - UpTime, */ \ + /* 296 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 324 - TotalOperationalHours, */ \ + /* 304 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), big-endian */ \ \ - /* 328 - CurrentHeapFree, */ \ + /* 308 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 336 - CurrentHeapUsed, */ \ + /* 316 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 344 - CurrentHeapHighWatermark, */ \ + /* 324 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 352 - FeatureMap, */ \ + /* 332 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x01, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), big-endian */ \ \ - /* 356 - NetworkName, */ \ + /* 336 - NetworkName, */ \ 0x00, 0x00, \ \ - /* 358 - ExtendedPanId, */ \ + /* 338 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 366 - OverrunCount, */ \ + /* 346 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 374 - PartitionId, */ \ + /* 354 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 378 - TxTotalCount, */ \ + /* 358 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 382 - TxUnicastCount, */ \ + /* 362 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 386 - TxBroadcastCount, */ \ + /* 366 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 390 - TxAckRequestedCount, */ \ + /* 370 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 394 - TxAckedCount, */ \ + /* 374 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 398 - TxNoAckRequestedCount, */ \ + /* 378 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 402 - TxDataCount, */ \ + /* 382 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 406 - TxDataPollCount, */ \ + /* 386 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 410 - TxBeaconCount, */ \ + /* 390 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 414 - TxBeaconRequestCount, */ \ + /* 394 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 418 - TxOtherCount, */ \ + /* 398 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 422 - TxRetryCount, */ \ + /* 402 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 426 - TxDirectMaxRetryExpiryCount, */ \ + /* 406 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 430 - TxIndirectMaxRetryExpiryCount, */ \ + /* 410 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 434 - TxErrCcaCount, */ \ + /* 414 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 438 - TxErrAbortCount, */ \ + /* 418 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 442 - TxErrBusyChannelCount, */ \ + /* 422 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 446 - RxTotalCount, */ \ + /* 426 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 450 - RxUnicastCount, */ \ + /* 430 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 454 - RxBroadcastCount, */ \ + /* 434 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 458 - RxDataCount, */ \ + /* 438 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 462 - RxDataPollCount, */ \ + /* 442 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 466 - RxBeaconCount, */ \ + /* 446 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 470 - RxBeaconRequestCount, */ \ + /* 450 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 474 - RxOtherCount, */ \ + /* 454 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 478 - RxAddressFilteredCount, */ \ + /* 458 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 482 - RxDestAddrFilteredCount, */ \ + /* 462 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 486 - RxDuplicatedCount, */ \ + /* 466 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 490 - RxErrNoFrameCount, */ \ + /* 470 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 494 - RxErrUnknownNeighborCount, */ \ + /* 474 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 498 - RxErrInvalidSrcAddrCount, */ \ + /* 478 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 502 - RxErrSecCount, */ \ + /* 482 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 506 - RxErrFcsCount, */ \ + /* 486 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 510 - RxErrOtherCount, */ \ + /* 490 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 514 - ActiveTimestamp, */ \ + /* 494 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 522 - PendingTimestamp, */ \ + /* 502 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 530 - delay, */ \ + /* 510 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 534 - ChannelMask, */ \ + /* 514 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 541 - FeatureMap, */ \ + /* 521 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0F, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), big-endian */ \ \ - /* 545 - BeaconLostCount, */ \ + /* 525 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 549 - BeaconRxCount, */ \ + /* 529 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 553 - PacketMulticastRxCount, */ \ + /* 533 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 557 - PacketMulticastTxCount, */ \ + /* 537 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 561 - PacketUnicastRxCount, */ \ + /* 541 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 565 - PacketUnicastTxCount, */ \ + /* 545 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 569 - CurrentMaxRate, */ \ + /* 549 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 577 - OverrunCount, */ \ + /* 557 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 585 - FeatureMap, */ \ + /* 565 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), big-endian */ \ \ - /* 589 - PacketRxCount, */ \ + /* 569 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 597 - PacketTxCount, */ \ + /* 577 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 605 - TxErrCount, */ \ + /* 585 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 613 - CollisionCount, */ \ + /* 593 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 621 - OverrunCount, */ \ + /* 601 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 629 - TimeSinceReset, */ \ + /* 609 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 637 - FeatureMap, */ \ + /* 617 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ /* Endpoint: 0, Cluster: Group Key Management (server), big-endian */ \ \ - /* 641 - GroupKeyMap, */ \ + /* 621 - GroupKeyMap, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -295,7 +295,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 895 - GroupTable, */ \ + /* 875 - GroupTable, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -313,17 +313,12 @@ \ /* Endpoint: 1, Cluster: On/Off (server), big-endian */ \ \ - /* 1149 - FeatureMap, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 1, Cluster: Bridged Device Basic (server), big-endian */ \ - \ - /* 1153 - SoftwareVersion, */ \ + /* 1129 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Fixed Label (server), big-endian */ \ \ - /* 1157 - label list, */ \ + /* 1133 - label list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -341,52 +336,52 @@ \ /* Endpoint: 1, Cluster: Door Lock (server), big-endian */ \ \ - /* 1411 - DoorOpenEvents, */ \ + /* 1387 - DoorOpenEvents, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1415 - DoorClosedEvents, */ \ + /* 1391 - DoorClosedEvents, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1419 - Language, */ \ + /* 1395 - Language, */ \ 2, 'e', 'n', \ \ - /* 1422 - AutoRelockTime, */ \ + /* 1398 - AutoRelockTime, */ \ 0x00, 0x00, 0x00, 0x10, \ \ /* Endpoint: 1, Cluster: Thermostat (server), big-endian */ \ \ - /* 1426 - FeatureMap, */ \ + /* 1402 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0B, \ \ /* Endpoint: 1, Cluster: IAS Zone (server), big-endian */ \ \ - /* 1430 - IAS CIE address, */ \ + /* 1406 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Test Cluster (server), big-endian */ \ \ - /* 1438 - bitmap32, */ \ + /* 1414 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1442 - bitmap64, */ \ + /* 1418 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1450 - int32u, */ \ + /* 1426 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1454 - int64u, */ \ + /* 1430 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1462 - int32s, */ \ + /* 1438 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1466 - int64s, */ \ + /* 1442 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1474 - list_int8u, */ \ + /* 1450 - list_int8u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1484 - list_octet_string, */ \ + /* 1460 - list_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -402,7 +397,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1738 - list_struct_octet_string, */ \ + /* 1714 - list_struct_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -438,7 +433,7 @@ /* 10 - Breadcrumb, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 38 - BasicCommissioningInfoList, */ \ + /* 18 - BasicCommissioningInfoList, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -454,228 +449,228 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 292 - FeatureMap, */ \ + /* 272 - FeatureMap, */ \ 0x06, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Network Commissioning (server), little-endian */ \ \ - /* 296 - Networks, */ \ + /* 276 - Networks, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 308 - LastConnectErrorValue, */ \ + /* 288 - LastConnectErrorValue, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 312 - FeatureMap, */ \ + /* 292 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: General Diagnostics (server), little-endian */ \ \ - /* 316 - UpTime, */ \ + /* 296 - UpTime, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 324 - TotalOperationalHours, */ \ + /* 304 - TotalOperationalHours, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Software Diagnostics (server), little-endian */ \ \ - /* 328 - CurrentHeapFree, */ \ + /* 308 - CurrentHeapFree, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 336 - CurrentHeapUsed, */ \ + /* 316 - CurrentHeapUsed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 344 - CurrentHeapHighWatermark, */ \ + /* 324 - CurrentHeapHighWatermark, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 352 - FeatureMap, */ \ + /* 332 - FeatureMap, */ \ 0x01, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server), little-endian */ \ \ - /* 356 - NetworkName, */ \ + /* 336 - NetworkName, */ \ 0x00, 0x00, \ \ - /* 358 - ExtendedPanId, */ \ + /* 338 - ExtendedPanId, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 366 - OverrunCount, */ \ + /* 346 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 374 - PartitionId, */ \ + /* 354 - PartitionId, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 378 - TxTotalCount, */ \ + /* 358 - TxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 382 - TxUnicastCount, */ \ + /* 362 - TxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 386 - TxBroadcastCount, */ \ + /* 366 - TxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 390 - TxAckRequestedCount, */ \ + /* 370 - TxAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 394 - TxAckedCount, */ \ + /* 374 - TxAckedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 398 - TxNoAckRequestedCount, */ \ + /* 378 - TxNoAckRequestedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 402 - TxDataCount, */ \ + /* 382 - TxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 406 - TxDataPollCount, */ \ + /* 386 - TxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 410 - TxBeaconCount, */ \ + /* 390 - TxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 414 - TxBeaconRequestCount, */ \ + /* 394 - TxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 418 - TxOtherCount, */ \ + /* 398 - TxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 422 - TxRetryCount, */ \ + /* 402 - TxRetryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 426 - TxDirectMaxRetryExpiryCount, */ \ + /* 406 - TxDirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 430 - TxIndirectMaxRetryExpiryCount, */ \ + /* 410 - TxIndirectMaxRetryExpiryCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 434 - TxErrCcaCount, */ \ + /* 414 - TxErrCcaCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 438 - TxErrAbortCount, */ \ + /* 418 - TxErrAbortCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 442 - TxErrBusyChannelCount, */ \ + /* 422 - TxErrBusyChannelCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 446 - RxTotalCount, */ \ + /* 426 - RxTotalCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 450 - RxUnicastCount, */ \ + /* 430 - RxUnicastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 454 - RxBroadcastCount, */ \ + /* 434 - RxBroadcastCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 458 - RxDataCount, */ \ + /* 438 - RxDataCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 462 - RxDataPollCount, */ \ + /* 442 - RxDataPollCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 466 - RxBeaconCount, */ \ + /* 446 - RxBeaconCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 470 - RxBeaconRequestCount, */ \ + /* 450 - RxBeaconRequestCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 474 - RxOtherCount, */ \ + /* 454 - RxOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 478 - RxAddressFilteredCount, */ \ + /* 458 - RxAddressFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 482 - RxDestAddrFilteredCount, */ \ + /* 462 - RxDestAddrFilteredCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 486 - RxDuplicatedCount, */ \ + /* 466 - RxDuplicatedCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 490 - RxErrNoFrameCount, */ \ + /* 470 - RxErrNoFrameCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 494 - RxErrUnknownNeighborCount, */ \ + /* 474 - RxErrUnknownNeighborCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 498 - RxErrInvalidSrcAddrCount, */ \ + /* 478 - RxErrInvalidSrcAddrCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 502 - RxErrSecCount, */ \ + /* 482 - RxErrSecCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 506 - RxErrFcsCount, */ \ + /* 486 - RxErrFcsCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 510 - RxErrOtherCount, */ \ + /* 490 - RxErrOtherCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 514 - ActiveTimestamp, */ \ + /* 494 - ActiveTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 522 - PendingTimestamp, */ \ + /* 502 - PendingTimestamp, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 530 - delay, */ \ + /* 510 - delay, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 534 - ChannelMask, */ \ + /* 514 - ChannelMask, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 541 - FeatureMap, */ \ + /* 521 - FeatureMap, */ \ 0x0F, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), little-endian */ \ \ - /* 545 - BeaconLostCount, */ \ + /* 525 - BeaconLostCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 549 - BeaconRxCount, */ \ + /* 529 - BeaconRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 553 - PacketMulticastRxCount, */ \ + /* 533 - PacketMulticastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 557 - PacketMulticastTxCount, */ \ + /* 537 - PacketMulticastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 561 - PacketUnicastRxCount, */ \ + /* 541 - PacketUnicastRxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 565 - PacketUnicastTxCount, */ \ + /* 545 - PacketUnicastTxCount, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 569 - CurrentMaxRate, */ \ + /* 549 - CurrentMaxRate, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 577 - OverrunCount, */ \ + /* 557 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 585 - FeatureMap, */ \ + /* 565 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), little-endian */ \ \ - /* 589 - PacketRxCount, */ \ + /* 569 - PacketRxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 597 - PacketTxCount, */ \ + /* 577 - PacketTxCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 605 - TxErrCount, */ \ + /* 585 - TxErrCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 613 - CollisionCount, */ \ + /* 593 - CollisionCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 621 - OverrunCount, */ \ + /* 601 - OverrunCount, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 629 - TimeSinceReset, */ \ + /* 609 - TimeSinceReset, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 637 - FeatureMap, */ \ + /* 617 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ /* Endpoint: 0, Cluster: Group Key Management (server), little-endian */ \ \ - /* 641 - GroupKeyMap, */ \ + /* 621 - GroupKeyMap, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -691,7 +686,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 895 - GroupTable, */ \ + /* 875 - GroupTable, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -709,17 +704,12 @@ \ /* Endpoint: 1, Cluster: On/Off (server), little-endian */ \ \ - /* 1149 - FeatureMap, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 1, Cluster: Bridged Device Basic (server), little-endian */ \ - \ - /* 1153 - SoftwareVersion, */ \ + /* 1129 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Fixed Label (server), little-endian */ \ \ - /* 1157 - label list, */ \ + /* 1133 - label list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -737,52 +727,52 @@ \ /* Endpoint: 1, Cluster: Door Lock (server), little-endian */ \ \ - /* 1411 - DoorOpenEvents, */ \ + /* 1387 - DoorOpenEvents, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1415 - DoorClosedEvents, */ \ + /* 1391 - DoorClosedEvents, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1419 - Language, */ \ + /* 1395 - Language, */ \ 2, 'e', 'n', \ \ - /* 1422 - AutoRelockTime, */ \ + /* 1398 - AutoRelockTime, */ \ 0x10, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Thermostat (server), little-endian */ \ \ - /* 1426 - FeatureMap, */ \ + /* 1402 - FeatureMap, */ \ 0x0B, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: IAS Zone (server), little-endian */ \ \ - /* 1430 - IAS CIE address, */ \ + /* 1406 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Test Cluster (server), little-endian */ \ \ - /* 1438 - bitmap32, */ \ + /* 1414 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1442 - bitmap64, */ \ + /* 1418 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1450 - int32u, */ \ + /* 1426 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1454 - int64u, */ \ + /* 1430 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1462 - int32s, */ \ + /* 1438 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1466 - int64s, */ \ + /* 1442 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1474 - list_int8u, */ \ + /* 1450 - list_int8u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1484 - list_octet_string, */ \ + /* 1460 - list_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -798,7 +788,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1738 - list_struct_octet_string, */ \ + /* 1714 - list_struct_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -817,7 +807,7 @@ #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (95) +#define GENERATED_DEFAULTS_COUNT (92) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -888,12 +878,11 @@ { \ \ /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Binding (server) */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ @@ -974,30 +963,30 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { 0x00000000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(30) }, /* Breadcrumb */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(38) }, /* BasicCommissioningInfoList */ \ + { 0x00000000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(10) }, /* Breadcrumb */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(18) }, /* BasicCommissioningInfoList */ \ { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* RegulatoryConfig */ \ { 0x00000003, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* LocationCapability */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(292) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(272) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ { 0x00000000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* MaxNetworks */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(296) }, /* Networks */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(276) }, /* Networks */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ScanMaxTimeSeconds */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ConnectMaxTimeSeconds */ \ { 0x00000004, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* InterfaceEnabled */ \ { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkingStatus */ \ { 0x00000006, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkID */ \ - { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(308) }, /* LastConnectErrorValue */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(312) }, /* FeatureMap */ \ + { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(288) }, /* LastConnectErrorValue */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(292) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NetworkInterfaces */ \ { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* RebootCount */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(316) }, /* UpTime */ \ - { 0x00000003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(324) }, /* TotalOperationalHours */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(296) }, /* UpTime */ \ + { 0x00000003, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(304) }, /* TotalOperationalHours */ \ { 0x00000004, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BootReasons */ \ { 0x00000005, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* ActiveHardwareFaults */ \ @@ -1008,23 +997,23 @@ \ /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ThreadMetrics */ \ - { 0x00000001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(328) }, /* CurrentHeapFree */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(336) }, /* CurrentHeapUsed */ \ - { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(344) }, /* CurrentHeapHighWatermark */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(352) }, /* FeatureMap */ \ + { 0x00000001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(308) }, /* CurrentHeapFree */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(316) }, /* CurrentHeapUsed */ \ + { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(324) }, /* CurrentHeapHighWatermark */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(332) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* channel */ \ { 0x00000001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* RoutingRole */ \ - { 0x00000002, ZAP_TYPE(OCTET_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(356) }, /* NetworkName */ \ + { 0x00000002, ZAP_TYPE(CHAR_STRING), 17, 0, ZAP_LONG_DEFAULTS_INDEX(336) }, /* NetworkName */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PanId */ \ - { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(358) }, /* ExtendedPanId */ \ + { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(338) }, /* ExtendedPanId */ \ { 0x00000005, ZAP_TYPE(OCTET_STRING), 18, 0, ZAP_EMPTY_DEFAULT() }, /* MeshLocalPrefix */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(366) }, /* OverrunCount */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(346) }, /* OverrunCount */ \ { 0x00000007, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NeighborTableList */ \ { 0x00000008, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* RouteTableList */ \ - { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(374) }, /* PartitionId */ \ + { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(354) }, /* PartitionId */ \ { 0x0000000A, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* weighting */ \ { 0x0000000B, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* DataVersion */ \ { 0x0000000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* StableDataVersion */ \ @@ -1037,50 +1026,50 @@ { 0x00000013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* PartitionIdChangeCount */ \ { 0x00000014, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* BetterPartitionAttachAttemptCount */ \ { 0x00000015, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ParentChangeCount */ \ - { 0x00000016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(378) }, /* TxTotalCount */ \ - { 0x00000017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(382) }, /* TxUnicastCount */ \ - { 0x00000018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(386) }, /* TxBroadcastCount */ \ - { 0x00000019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(390) }, /* TxAckRequestedCount */ \ - { 0x0000001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(394) }, /* TxAckedCount */ \ - { 0x0000001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(398) }, /* TxNoAckRequestedCount */ \ - { 0x0000001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(402) }, /* TxDataCount */ \ - { 0x0000001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(406) }, /* TxDataPollCount */ \ - { 0x0000001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(410) }, /* TxBeaconCount */ \ - { 0x0000001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(414) }, /* TxBeaconRequestCount */ \ - { 0x00000020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(418) }, /* TxOtherCount */ \ - { 0x00000021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(422) }, /* TxRetryCount */ \ - { 0x00000022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(426) }, /* TxDirectMaxRetryExpiryCount */ \ - { 0x00000023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(430) }, /* TxIndirectMaxRetryExpiryCount */ \ - { 0x00000024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(434) }, /* TxErrCcaCount */ \ - { 0x00000025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(438) }, /* TxErrAbortCount */ \ - { 0x00000026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(442) }, /* TxErrBusyChannelCount */ \ - { 0x00000027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(446) }, /* RxTotalCount */ \ - { 0x00000028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(450) }, /* RxUnicastCount */ \ - { 0x00000029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(454) }, /* RxBroadcastCount */ \ - { 0x0000002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(458) }, /* RxDataCount */ \ - { 0x0000002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(462) }, /* RxDataPollCount */ \ - { 0x0000002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(466) }, /* RxBeaconCount */ \ - { 0x0000002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(470) }, /* RxBeaconRequestCount */ \ - { 0x0000002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(474) }, /* RxOtherCount */ \ - { 0x0000002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(478) }, /* RxAddressFilteredCount */ \ - { 0x00000030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(482) }, /* RxDestAddrFilteredCount */ \ - { 0x00000031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(486) }, /* RxDuplicatedCount */ \ - { 0x00000032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(490) }, /* RxErrNoFrameCount */ \ - { 0x00000033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(494) }, /* RxErrUnknownNeighborCount */ \ - { 0x00000034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(498) }, /* RxErrInvalidSrcAddrCount */ \ - { 0x00000035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(502) }, /* RxErrSecCount */ \ - { 0x00000036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(506) }, /* RxErrFcsCount */ \ - { 0x00000037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(510) }, /* RxErrOtherCount */ \ - { 0x00000038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(514) }, /* ActiveTimestamp */ \ - { 0x00000039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(522) }, /* PendingTimestamp */ \ - { 0x0000003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(530) }, /* delay */ \ + { 0x00000016, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(358) }, /* TxTotalCount */ \ + { 0x00000017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(362) }, /* TxUnicastCount */ \ + { 0x00000018, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(366) }, /* TxBroadcastCount */ \ + { 0x00000019, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(370) }, /* TxAckRequestedCount */ \ + { 0x0000001A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(374) }, /* TxAckedCount */ \ + { 0x0000001B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(378) }, /* TxNoAckRequestedCount */ \ + { 0x0000001C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(382) }, /* TxDataCount */ \ + { 0x0000001D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(386) }, /* TxDataPollCount */ \ + { 0x0000001E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(390) }, /* TxBeaconCount */ \ + { 0x0000001F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(394) }, /* TxBeaconRequestCount */ \ + { 0x00000020, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(398) }, /* TxOtherCount */ \ + { 0x00000021, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(402) }, /* TxRetryCount */ \ + { 0x00000022, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(406) }, /* TxDirectMaxRetryExpiryCount */ \ + { 0x00000023, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(410) }, /* TxIndirectMaxRetryExpiryCount */ \ + { 0x00000024, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(414) }, /* TxErrCcaCount */ \ + { 0x00000025, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(418) }, /* TxErrAbortCount */ \ + { 0x00000026, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(422) }, /* TxErrBusyChannelCount */ \ + { 0x00000027, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(426) }, /* RxTotalCount */ \ + { 0x00000028, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(430) }, /* RxUnicastCount */ \ + { 0x00000029, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(434) }, /* RxBroadcastCount */ \ + { 0x0000002A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(438) }, /* RxDataCount */ \ + { 0x0000002B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(442) }, /* RxDataPollCount */ \ + { 0x0000002C, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(446) }, /* RxBeaconCount */ \ + { 0x0000002D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(450) }, /* RxBeaconRequestCount */ \ + { 0x0000002E, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(454) }, /* RxOtherCount */ \ + { 0x0000002F, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(458) }, /* RxAddressFilteredCount */ \ + { 0x00000030, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(462) }, /* RxDestAddrFilteredCount */ \ + { 0x00000031, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(466) }, /* RxDuplicatedCount */ \ + { 0x00000032, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(470) }, /* RxErrNoFrameCount */ \ + { 0x00000033, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(474) }, /* RxErrUnknownNeighborCount */ \ + { 0x00000034, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(478) }, /* RxErrInvalidSrcAddrCount */ \ + { 0x00000035, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(482) }, /* RxErrSecCount */ \ + { 0x00000036, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(486) }, /* RxErrFcsCount */ \ + { 0x00000037, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(490) }, /* RxErrOtherCount */ \ + { 0x00000038, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(494) }, /* ActiveTimestamp */ \ + { 0x00000039, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(502) }, /* PendingTimestamp */ \ + { 0x0000003A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(510) }, /* delay */ \ { 0x0000003B, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SecurityPolicy */ \ - { 0x0000003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(534) }, /* ChannelMask */ \ + { 0x0000003C, ZAP_TYPE(OCTET_STRING), 5, 0, ZAP_LONG_DEFAULTS_INDEX(514) }, /* ChannelMask */ \ { 0x0000003D, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* OperationalDatasetComponents */ \ { 0x0000003E, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* ActiveNetworkFaultsList */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(541) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(521) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ @@ -1089,36 +1078,36 @@ { 0x00000002, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* WiFiVersion */ \ { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChannelNumber */ \ { 0x00000004, ZAP_TYPE(INT8S), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Rssi */ \ - { 0x00000005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(545) }, /* BeaconLostCount */ \ - { 0x00000006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(549) }, /* BeaconRxCount */ \ - { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(553) }, /* PacketMulticastRxCount */ \ - { 0x00000008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(557) }, /* PacketMulticastTxCount */ \ - { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(561) }, /* PacketUnicastRxCount */ \ - { 0x0000000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(565) }, /* PacketUnicastTxCount */ \ - { 0x0000000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(569) }, /* CurrentMaxRate */ \ - { 0x0000000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(577) }, /* OverrunCount */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(585) }, /* FeatureMap */ \ + { 0x00000005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(525) }, /* BeaconLostCount */ \ + { 0x00000006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(529) }, /* BeaconRxCount */ \ + { 0x00000007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(533) }, /* PacketMulticastRxCount */ \ + { 0x00000008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(537) }, /* PacketMulticastTxCount */ \ + { 0x00000009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(541) }, /* PacketUnicastRxCount */ \ + { 0x0000000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(545) }, /* PacketUnicastTxCount */ \ + { 0x0000000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(549) }, /* CurrentMaxRate */ \ + { 0x0000000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(557) }, /* OverrunCount */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(565) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* PHYRate */ \ { 0x00000001, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* FullDuplex */ \ - { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(589) }, /* PacketRxCount */ \ - { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(597) }, /* PacketTxCount */ \ - { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(605) }, /* TxErrCount */ \ - { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(613) }, /* CollisionCount */ \ - { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(621) }, /* OverrunCount */ \ + { 0x00000002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(569) }, /* PacketRxCount */ \ + { 0x00000003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(577) }, /* PacketTxCount */ \ + { 0x00000004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(585) }, /* TxErrCount */ \ + { 0x00000005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(593) }, /* CollisionCount */ \ + { 0x00000006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(601) }, /* OverrunCount */ \ { 0x00000007, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* CarrierDetect */ \ - { 0x00000008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(629) }, /* TimeSinceReset */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(637) }, /* FeatureMap */ \ + { 0x00000008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(609) }, /* TimeSinceReset */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(617) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { 0x00000000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* WindowStatus */ \ + { 0x00000000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ { 0x00000001, ZAP_TYPE(FABRIC_IDX), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* AdminVendorId */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ @@ -1132,8 +1121,8 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(641) }, /* GroupKeyMap */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(895) }, /* GroupTable */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(621) }, /* GroupKeyMap */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(875) }, /* GroupTable */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ @@ -1174,7 +1163,7 @@ { 0x00004001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OnTime */ \ { 0x00004002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OffWaitTime */ \ { 0x00004003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* StartUpOnOff */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1149) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1129) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Level Control (server) */ \ @@ -1210,12 +1199,11 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Binding (server) */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ @@ -1233,9 +1221,9 @@ ZAP_EMPTY_DEFAULT() }, /* HardwareVersion */ \ { 0x00000008, ZAP_TYPE(CHAR_STRING), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(SINGLETON), \ ZAP_EMPTY_DEFAULT() }, /* HardwareVersionString */ \ - { 0x00000009, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(SINGLETON), \ - ZAP_LONG_DEFAULTS_INDEX(1153) }, /* SoftwareVersion */ \ - { 0x0000000A, ZAP_TYPE(CHAR_STRING), 65, ZAP_ATTRIBUTE_MASK(SINGLETON), \ + { 0x00000009, ZAP_TYPE(INT32U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(SINGLETON), \ + ZAP_EMPTY_DEFAULT() }, /* SoftwareVersion */ \ + { 0x0000000A, ZAP_TYPE(CHAR_STRING), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(SINGLETON), \ ZAP_EMPTY_DEFAULT() }, /* SoftwareVersionString */ \ { 0x0000000B, ZAP_TYPE(CHAR_STRING), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(SINGLETON), \ ZAP_EMPTY_DEFAULT() }, /* ManufacturingDate */ \ @@ -1256,7 +1244,7 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Fixed Label (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1157) }, /* label list */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1133) }, /* label list */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Door Lock (server) */ \ @@ -1264,9 +1252,9 @@ { 0x00000001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LockType */ \ { 0x00000002, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ActuatorEnabled */ \ { 0x00000003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_EMPTY_DEFAULT() }, /* DoorState */ \ - { 0x00000004, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1411) }, /* DoorOpenEvents */ \ + { 0x00000004, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1387) }, /* DoorOpenEvents */ \ { 0x00000005, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(1415) }, /* DoorClosedEvents */ \ + ZAP_LONG_DEFAULTS_INDEX(1391) }, /* DoorClosedEvents */ \ { 0x00000006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* OpenPeriod */ \ { 0x00000011, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(10) }, /* NumberOfTotalUsersSupported */ \ { 0x00000012, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(10) }, /* NumberOfPINUsersSupported */ \ @@ -1276,8 +1264,8 @@ { 0x00000017, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(6) }, /* MaxPINCodeLength */ \ { 0x00000018, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(6) }, /* MinPINCodeLength */ \ { 0x0000001B, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(1) }, /* CredentialRulesSupport */ \ - { 0x00000021, ZAP_TYPE(CHAR_STRING), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1419) }, /* Language */ \ - { 0x00000023, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1422) }, /* AutoRelockTime */ \ + { 0x00000021, ZAP_TYPE(CHAR_STRING), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1395) }, /* Language */ \ + { 0x00000023, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1398) }, /* AutoRelockTime */ \ { 0x00000024, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(4) }, /* SoundVolume */ \ { 0x00000025, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -1347,7 +1335,7 @@ { 0x00000020, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* start of week */ \ { 0x00000021, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(7) }, /* number of weekly transitions */ \ { 0x00000022, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(4) }, /* number of daily transitions */ \ - { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1426) }, /* FeatureMap */ \ + { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1402) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Color Control (server) */ \ @@ -1442,7 +1430,7 @@ { 0x00000001, ZAP_TYPE(ENUM16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* zone type */ \ { 0x00000002, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* zone status */ \ { 0x00000010, ZAP_TYPE(NODE_ID), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(1430) }, /* IAS CIE address */ \ + ZAP_LONG_DEFAULTS_INDEX(1406) }, /* IAS CIE address */ \ { 0x00000011, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xff) }, /* Zone ID */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ @@ -1454,24 +1442,24 @@ { 0x00000000, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(false) }, /* boolean */ \ { 0x00000001, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap8 */ \ { 0x00000002, ZAP_TYPE(BITMAP16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap16 */ \ - { 0x00000003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1438) }, /* bitmap32 */ \ - { 0x00000004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1442) }, /* bitmap64 */ \ + { 0x00000003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1414) }, /* bitmap32 */ \ + { 0x00000004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1418) }, /* bitmap64 */ \ { 0x00000005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8u */ \ { 0x00000006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16u */ \ - { 0x00000008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1450) }, /* int32u */ \ - { 0x0000000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1454) }, /* int64u */ \ + { 0x00000008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1426) }, /* int32u */ \ + { 0x0000000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1430) }, /* int64u */ \ { 0x0000000D, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8s */ \ { 0x0000000E, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16s */ \ - { 0x00000010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1462) }, /* int32s */ \ - { 0x00000014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1466) }, /* int64s */ \ + { 0x00000010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1438) }, /* int32s */ \ + { 0x00000014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1442) }, /* int64s */ \ { 0x00000015, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum8 */ \ { 0x00000016, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum16 */ \ { 0x00000019, ZAP_TYPE(OCTET_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* octet_string */ \ - { 0x0000001A, ZAP_TYPE(ARRAY), 10, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1474) }, /* list_int8u */ \ + { 0x0000001A, ZAP_TYPE(ARRAY), 10, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1450) }, /* list_int8u */ \ { 0x0000001B, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(1484) }, /* list_octet_string */ \ + ZAP_LONG_DEFAULTS_INDEX(1460) }, /* list_octet_string */ \ { 0x0000001C, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(1738) }, /* list_struct_octet_string */ \ + ZAP_LONG_DEFAULTS_INDEX(1714) }, /* list_struct_octet_string */ \ { 0x0000001D, ZAP_TYPE(LONG_OCTET_STRING), 1002, ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* long_octet_string */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ @@ -1481,12 +1469,11 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 2, Cluster: Occupancy Sensing (server) */ \ { 0x00000000, ZAP_TYPE(BITMAP8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* occupancy */ \ @@ -1761,227 +1748,639 @@ #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask #define GENERATED_CLUSTER_COUNT 57 -#define GENERATED_CLUSTERS \ - { \ - { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(0), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { \ - 0x0000001E, ZAP_ATTRIBUTE_INDEX(5), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Binding (server) */ \ - { 0x00000028, \ - ZAP_ATTRIBUTE_INDEX(6), \ - 20, \ - 39, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayBasicServer }, /* Endpoint: 0, Cluster: Basic (server) */ \ - { \ - 0x00000029, ZAP_ATTRIBUTE_INDEX(26), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ - { 0x0000002B, \ - ZAP_ATTRIBUTE_INDEX(27), \ - 3, \ - 38, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayLocalizationConfigurationServer }, /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ - { 0x0000002C, \ - ZAP_ATTRIBUTE_INDEX(30), \ - 4, \ - 4, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayTimeFormatLocalizationServer }, /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ - { 0x0000002D, \ - ZAP_ATTRIBUTE_INDEX(34), \ - 3, \ - 7, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayUnitLocalizationServer }, /* Endpoint: 0, Cluster: Unit Localization (server) */ \ - { \ - 0x00000030, ZAP_ATTRIBUTE_INDEX(34), 6, 270, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: General Commissioning (server) */ \ - { \ - 0x00000031, ZAP_ATTRIBUTE_INDEX(40), 10, 60, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ - { \ - 0x00000032, ZAP_ATTRIBUTE_INDEX(53), 0, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ - { \ - 0x00000033, ZAP_ATTRIBUTE_INDEX(53), 9, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ - { \ - 0x00000034, ZAP_ATTRIBUTE_INDEX(62), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - { \ - 0x00000035, ZAP_ATTRIBUTE_INDEX(68), 65, 247, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - { \ - 0x00000036, ZAP_ATTRIBUTE_INDEX(133), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ - { \ - 0x00000037, ZAP_ATTRIBUTE_INDEX(148), 11, 57, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ - { \ - 0x0000003C, ZAP_ATTRIBUTE_INDEX(159), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(163), 7, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { \ - 0x0000003F, ZAP_ATTRIBUTE_INDEX(167), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Group Key Management (server) */ \ - { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(173), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ - { \ - 0x00000041, ZAP_ATTRIBUTE_INDEX(175), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: User Label (server) */ \ - { \ - 0x00000405, ZAP_ATTRIBUTE_INDEX(177), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ - { 0x00000003, \ - ZAP_ATTRIBUTE_INDEX(181), \ - 2, \ - 4, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayIdentifyServer }, /* Endpoint: 1, Cluster: Identify (server) */ \ - { 0x00000004, \ - ZAP_ATTRIBUTE_INDEX(183), \ - 2, \ - 3, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayGroupsServer }, /* Endpoint: 1, Cluster: Groups (server) */ \ - { 0x00000005, \ - ZAP_ATTRIBUTE_INDEX(185), \ - 6, \ - 8, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayScenesServer }, /* Endpoint: 1, Cluster: Scenes (server) */ \ - { 0x00000006, \ - ZAP_ATTRIBUTE_INDEX(191), \ - 7, \ - 13, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ - { 0x00000008, \ - ZAP_ATTRIBUTE_INDEX(198), \ - 15, \ - 23, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ - { \ - 0x0000000F, ZAP_ATTRIBUTE_INDEX(213), 4, 5, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Binary Input (Basic) (server) */ \ - { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(217), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ - { \ - 0x0000001E, ZAP_ATTRIBUTE_INDEX(222), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Binding (server) */ \ - { \ - 0x00000039, ZAP_ATTRIBUTE_INDEX(223), 15, 36, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Bridged Device Basic (server) */ \ - { \ - 0x0000003B, ZAP_ATTRIBUTE_INDEX(238), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Switch (server) */ \ - { \ - 0x00000040, ZAP_ATTRIBUTE_INDEX(238), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Fixed Label (server) */ \ - { 0x00000101, \ - ZAP_ATTRIBUTE_INDEX(243), \ - 28, \ - 46, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | \ - ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayDoorLockServer }, /* Endpoint: 1, Cluster: Door Lock (server) */ \ - { \ - 0x00000102, ZAP_ATTRIBUTE_INDEX(271), 19, 31, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Window Covering (server) */ \ - { \ - 0x00000103, ZAP_ATTRIBUTE_INDEX(290), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Barrier Control (server) */ \ - { 0x00000201, \ - ZAP_ATTRIBUTE_INDEX(295), \ - 10, \ - 17, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayThermostatServer }, /* Endpoint: 1, Cluster: Thermostat (server) */ \ - { 0x00000300, \ - ZAP_ATTRIBUTE_INDEX(305), \ - 51, \ - 337, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayColorControlServer }, /* Endpoint: 1, Cluster: Color Control (server) */ \ - { \ - 0x00000402, ZAP_ATTRIBUTE_INDEX(356), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ - { \ - 0x00000403, ZAP_ATTRIBUTE_INDEX(360), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ - { \ - 0x00000404, ZAP_ATTRIBUTE_INDEX(364), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ - { \ - 0x00000405, ZAP_ATTRIBUTE_INDEX(368), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ - { 0x00000500, \ - ZAP_ATTRIBUTE_INDEX(372), \ - 6, \ - 16, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | \ - ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ - chipFuncArrayIasZoneServer }, /* Endpoint: 1, Cluster: IAS Zone (server) */ \ - { \ - 0x00000503, ZAP_ATTRIBUTE_INDEX(378), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ - { \ - 0x00000504, ZAP_ATTRIBUTE_INDEX(380), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 1, Cluster: Channel (client) */ \ - { \ - 0x00000505, ZAP_ATTRIBUTE_INDEX(381), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 1, Cluster: Target Navigator (client) */ \ - { \ - 0x00000506, ZAP_ATTRIBUTE_INDEX(382), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 1, Cluster: Media Playback (client) */ \ - { \ - 0x00000507, ZAP_ATTRIBUTE_INDEX(383), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 1, Cluster: Media Input (client) */ \ - { \ - 0x00000509, ZAP_ATTRIBUTE_INDEX(384), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 1, Cluster: Keypad Input (client) */ \ - { \ - 0x0000050A, ZAP_ATTRIBUTE_INDEX(385), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 1, Cluster: Content Launcher (client) */ \ - { \ - 0x0000050B, ZAP_ATTRIBUTE_INDEX(386), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 1, Cluster: Audio Output (client) */ \ - { \ - 0x0000050C, ZAP_ATTRIBUTE_INDEX(387), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 1, Cluster: Application Launcher (client) */ \ - { \ - 0x0000050D, ZAP_ATTRIBUTE_INDEX(388), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 1, Cluster: Application Basic (client) */ \ - { \ - 0x0000050E, ZAP_ATTRIBUTE_INDEX(389), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 1, Cluster: Account Login (client) */ \ - { \ - 0x0000050F, ZAP_ATTRIBUTE_INDEX(387), 21, 1582, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Test Cluster (server) */ \ - { 0x00000006, \ - ZAP_ATTRIBUTE_INDEX(411), \ - 2, \ - 3, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/Off (server) */ \ - { \ - 0x0000001D, ZAP_ATTRIBUTE_INDEX(413), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 2, Cluster: Descriptor (server) */ \ - { 0x00000406, \ - ZAP_ATTRIBUTE_INDEX(418), \ - 4, \ - 5, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayOccupancySensingServer }, /* Endpoint: 2, Cluster: Occupancy Sensing (server) */ \ - } + +// clang-format off +#define GENERATED_CLUSTERS { \ + { \ + /* Endpoint: 0, Cluster: Descriptor (server) */ \ + .clusterId = 0x0000001D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(0), \ + .attributeCount = 5, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Binding (server) */ \ + .clusterId = 0x0000001E, \ + .attributes = ZAP_ATTRIBUTE_INDEX(5), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 0 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Basic (server) */ \ + .clusterId = 0x00000028, \ + .attributes = ZAP_ATTRIBUTE_INDEX(6), \ + .attributeCount = 20, \ + .clusterSize = 39, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayBasicServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ + .clusterId = 0x00000029, \ + .attributes = ZAP_ATTRIBUTE_INDEX(26), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 3 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 7 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Localization Configuration (server) */ \ + .clusterId = 0x0000002B, \ + .attributes = ZAP_ATTRIBUTE_INDEX(27), \ + .attributeCount = 3, \ + .clusterSize = 38, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayLocalizationConfigurationServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Time Format Localization (server) */ \ + .clusterId = 0x0000002C, \ + .attributes = ZAP_ATTRIBUTE_INDEX(30), \ + .attributeCount = 4, \ + .clusterSize = 4, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayTimeFormatLocalizationServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Unit Localization (server) */ \ + .clusterId = 0x0000002D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(34), \ + .attributeCount = 3, \ + .clusterSize = 7, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: General Commissioning (server) */ \ + .clusterId = 0x00000030, \ + .attributes = ZAP_ATTRIBUTE_INDEX(37), \ + .attributeCount = 6, \ + .clusterSize = 270, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 10 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 15 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ + .clusterId = 0x00000031, \ + .attributes = ZAP_ATTRIBUTE_INDEX(43), \ + .attributeCount = 10, \ + .clusterSize = 60, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 18 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 25 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ + .clusterId = 0x00000032, \ + .attributes = ZAP_ATTRIBUTE_INDEX(53), \ + .attributeCount = 0, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 28 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ + .clusterId = 0x00000033, \ + .attributes = ZAP_ATTRIBUTE_INDEX(53), \ + .attributeCount = 9, \ + .clusterSize = 17, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ + .clusterId = 0x00000034, \ + .attributes = ZAP_ATTRIBUTE_INDEX(62), \ + .attributeCount = 6, \ + .clusterSize = 30, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 30 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ + .clusterId = 0x00000035, \ + .attributes = ZAP_ATTRIBUTE_INDEX(68), \ + .attributeCount = 65, \ + .clusterSize = 247, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ + .clusterId = 0x00000036, \ + .attributes = ZAP_ATTRIBUTE_INDEX(133), \ + .attributeCount = 15, \ + .clusterSize = 58, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ + .clusterId = 0x00000037, \ + .attributes = ZAP_ATTRIBUTE_INDEX(148), \ + .attributeCount = 11, \ + .clusterSize = 57, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 32 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ + .clusterId = 0x0000003C, \ + .attributes = ZAP_ATTRIBUTE_INDEX(159), \ + .attributeCount = 4, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 34 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ + .clusterId = 0x0000003E, \ + .attributes = ZAP_ATTRIBUTE_INDEX(163), \ + .attributeCount = 7, \ + .clusterSize = 4, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 38 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 48 ) ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Group Key Management (server) */ \ + .clusterId = 0x0000003F, \ + .attributes = ZAP_ATTRIBUTE_INDEX(170), \ + .attributeCount = 3, \ + .clusterSize = 510, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Fixed Label (server) */ \ + .clusterId = 0x00000040, \ + .attributes = ZAP_ATTRIBUTE_INDEX(173), \ + .attributeCount = 2, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: User Label (server) */ \ + .clusterId = 0x00000041, \ + .attributes = ZAP_ATTRIBUTE_INDEX(175), \ + .attributeCount = 2, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ + .clusterId = 0x00000405, \ + .attributes = ZAP_ATTRIBUTE_INDEX(177), \ + .attributeCount = 4, \ + .clusterSize = 8, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Identify (server) */ \ + .clusterId = 0x00000003, \ + .attributes = ZAP_ATTRIBUTE_INDEX(181), \ + .attributeCount = 2, \ + .clusterSize = 4, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayIdentifyServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 53 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 56 ) ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Groups (server) */ \ + .clusterId = 0x00000004, \ + .attributes = ZAP_ATTRIBUTE_INDEX(183), \ + .attributeCount = 2, \ + .clusterSize = 3, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayGroupsServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 58 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 65 ) ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Scenes (server) */ \ + .clusterId = 0x00000005, \ + .attributes = ZAP_ATTRIBUTE_INDEX(185), \ + .attributeCount = 6, \ + .clusterSize = 8, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayScenesServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 70 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 78 ) ,\ + },\ + { \ + /* Endpoint: 1, Cluster: On/Off (server) */ \ + .clusterId = 0x00000006, \ + .attributes = ZAP_ATTRIBUTE_INDEX(191), \ + .attributeCount = 7, \ + .clusterSize = 13, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayOnOffServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 85 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Level Control (server) */ \ + .clusterId = 0x00000008, \ + .attributes = ZAP_ATTRIBUTE_INDEX(198), \ + .attributeCount = 15, \ + .clusterSize = 23, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayLevelControlServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 89 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Binary Input (Basic) (server) */ \ + .clusterId = 0x0000000F, \ + .attributes = ZAP_ATTRIBUTE_INDEX(213), \ + .attributeCount = 4, \ + .clusterSize = 5, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Descriptor (server) */ \ + .clusterId = 0x0000001D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(217), \ + .attributeCount = 5, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Binding (server) */ \ + .clusterId = 0x0000001E, \ + .attributes = ZAP_ATTRIBUTE_INDEX(222), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 98 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Bridged Device Basic (server) */ \ + .clusterId = 0x00000039, \ + .attributes = ZAP_ATTRIBUTE_INDEX(223), \ + .attributeCount = 15, \ + .clusterSize = 36, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 101 ) ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Switch (server) */ \ + .clusterId = 0x0000003B, \ + .attributes = ZAP_ATTRIBUTE_INDEX(238), \ + .attributeCount = 3, \ + .clusterSize = 4, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Fixed Label (server) */ \ + .clusterId = 0x00000040, \ + .attributes = ZAP_ATTRIBUTE_INDEX(241), \ + .attributeCount = 2, \ + .clusterSize = 256, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Door Lock (server) */ \ + .clusterId = 0x00000101, \ + .attributes = ZAP_ATTRIBUTE_INDEX(243), \ + .attributeCount = 28, \ + .clusterSize = 46, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ + .functions = chipFuncArrayDoorLockServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 103 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Window Covering (server) */ \ + .clusterId = 0x00000102, \ + .attributes = ZAP_ATTRIBUTE_INDEX(271), \ + .attributeCount = 19, \ + .clusterSize = 31, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 112 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Barrier Control (server) */ \ + .clusterId = 0x00000103, \ + .attributes = ZAP_ATTRIBUTE_INDEX(290), \ + .attributeCount = 5, \ + .clusterSize = 7, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 116 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Thermostat (server) */ \ + .clusterId = 0x00000201, \ + .attributes = ZAP_ATTRIBUTE_INDEX(295), \ + .attributeCount = 10, \ + .clusterSize = 17, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayThermostatServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 119 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Color Control (server) */ \ + .clusterId = 0x00000300, \ + .attributes = ZAP_ATTRIBUTE_INDEX(305), \ + .attributeCount = 51, \ + .clusterSize = 337, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayColorControlServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 123 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ + .clusterId = 0x00000402, \ + .attributes = ZAP_ATTRIBUTE_INDEX(356), \ + .attributeCount = 4, \ + .clusterSize = 8, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ + .clusterId = 0x00000403, \ + .attributes = ZAP_ATTRIBUTE_INDEX(360), \ + .attributeCount = 4, \ + .clusterSize = 8, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ + .clusterId = 0x00000404, \ + .attributes = ZAP_ATTRIBUTE_INDEX(364), \ + .attributeCount = 4, \ + .clusterSize = 8, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ + .clusterId = 0x00000405, \ + .attributes = ZAP_ATTRIBUTE_INDEX(368), \ + .attributeCount = 4, \ + .clusterSize = 8, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: IAS Zone (server) */ \ + .clusterId = 0x00000500, \ + .attributes = ZAP_ATTRIBUTE_INDEX(372), \ + .attributeCount = 6, \ + .clusterSize = 16, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ + .functions = chipFuncArrayIasZoneServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 138 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 140 ) ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ + .clusterId = 0x00000503, \ + .attributes = ZAP_ATTRIBUTE_INDEX(378), \ + .attributeCount = 2, \ + .clusterSize = 35, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Channel (client) */ \ + .clusterId = 0x00000504, \ + .attributes = ZAP_ATTRIBUTE_INDEX(380), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 143 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Target Navigator (client) */ \ + .clusterId = 0x00000505, \ + .attributes = ZAP_ATTRIBUTE_INDEX(381), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 147 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Media Playback (client) */ \ + .clusterId = 0x00000506, \ + .attributes = ZAP_ATTRIBUTE_INDEX(382), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 149 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Media Input (client) */ \ + .clusterId = 0x00000507, \ + .attributes = ZAP_ATTRIBUTE_INDEX(383), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 161 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Keypad Input (client) */ \ + .clusterId = 0x00000509, \ + .attributes = ZAP_ATTRIBUTE_INDEX(384), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 166 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Content Launcher (client) */ \ + .clusterId = 0x0000050A, \ + .attributes = ZAP_ATTRIBUTE_INDEX(385), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 168 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Audio Output (client) */ \ + .clusterId = 0x0000050B, \ + .attributes = ZAP_ATTRIBUTE_INDEX(386), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 171 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Application Launcher (client) */ \ + .clusterId = 0x0000050C, \ + .attributes = ZAP_ATTRIBUTE_INDEX(387), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 174 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Application Basic (client) */ \ + .clusterId = 0x0000050D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(388), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Account Login (client) */ \ + .clusterId = 0x0000050E, \ + .attributes = ZAP_ATTRIBUTE_INDEX(389), \ + .attributeCount = 1, \ + .clusterSize = 2, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 178 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Test Cluster (server) */ \ + .clusterId = 0x0000050F, \ + .attributes = ZAP_ATTRIBUTE_INDEX(390), \ + .attributeCount = 21, \ + .clusterSize = 1582, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 182 ) ,\ + .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 185 ) ,\ + },\ + { \ + /* Endpoint: 2, Cluster: On/Off (server) */ \ + .clusterId = 0x00000006, \ + .attributes = ZAP_ATTRIBUTE_INDEX(411), \ + .attributeCount = 2, \ + .clusterSize = 3, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayOnOffServer, \ + .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 187 ) ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 2, Cluster: Descriptor (server) */ \ + .clusterId = 0x0000001D, \ + .attributes = ZAP_ATTRIBUTE_INDEX(413), \ + .attributeCount = 5, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(SERVER), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 2, Cluster: Occupancy Sensing (server) */ \ + .clusterId = 0x00000406, \ + .attributes = ZAP_ATTRIBUTE_INDEX(418), \ + .attributeCount = 4, \ + .clusterSize = 5, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayOccupancySensingServer, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ +} + +// clang-format on #define ZAP_CLUSTER_INDEX(index) (&generatedClusters[index]) @@ -1990,7 +2389,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 20, 2000 }, { ZAP_CLUSTER_INDEX(20), 33, 3090 }, { ZAP_CLUSTER_INDEX(53), 3, 8 }, \ + { ZAP_CLUSTER_INDEX(0), 21, 1359 }, { ZAP_CLUSTER_INDEX(21), 33, 2477 }, { ZAP_CLUSTER_INDEX(54), 3, 8 }, \ } // Largest attribute size is needed for various buffers @@ -2000,7 +2399,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (75) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (5098) +#define ATTRIBUTE_MAX_SIZE (3844) // 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 924167fa255e8b..70b2e3f8d1c32a 100644 --- a/zzz_generated/window-app/zap-generated/endpoint_config.h +++ b/zzz_generated/window-app/zap-generated/endpoint_config.h @@ -585,12 +585,11 @@ { \ \ /* Endpoint: 0, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Access Control (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -813,11 +812,11 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ - { 0x00000000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* WindowStatus */ \ + { 0x00000000, ZAP_TYPE(INT8U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* WindowStatus */ \ { 0x00000001, ZAP_TYPE(FABRIC_IDX), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* AdminFabricIndex */ \ - { 0x00000002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* AdminVendorId */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + ZAP_EMPTY_DEFAULT() }, /* AdminFabricIndex */ \ + { 0x00000002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AdminVendorId */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* NOCs */ \ @@ -846,12 +845,11 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Window Covering (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Type */ \ @@ -890,12 +888,11 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ - { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ - { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ - { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ - { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ - { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ - ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ + { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ + { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* client list */ \ + { 0x00000003, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* parts list */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* ClusterRevision */ \ \ /* Endpoint: 2, Cluster: Window Covering (server) */ \ { 0x00000000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Type */ \